How can I create a view in Zoho Creator which shows only the current record?

How can I create a view in Zoho Creator which shows only the current record?

To create a view which shows only the current record,

  1. Add a hidden field in your form to identify the current record based on some value. For instance, let us create a hidden field named TXT with default value as "new". When a new record is submitted, the TXT field will hold the value "new" 

  2. To update the TXT field of the previous record, with value as "old", write an Form Actions -> on add -> validate script as given below. The script will be executed when new form data is submitted. The script will fetch the record whose TXT value is "new" and update it with value as "old".

    on add -> on validate script


    if (count(Form1[TXT == "new"]) > 0)
    {
    dat = Form1 [TXT == "new"];
    dat.TXT = "old";
    }
  3. Create a view with criteria as [TXT == "new"] to display only the current record, as given below. 
    list  "Current Record"
    {
    show all rows from Form1 [TXT == "new"]
    (
    Name
    Number
    City
    )
    }