How can I fetch records within a given range

How can I fetch records within a given range

To fetch records from a Form within a given range, specify the start index and end index range in the Fetch records task, as shown in the sample code below. Here, the first five records that are sorted by Added_Time field will be fetched from the Contact form.  You can add the script to the  Form Actions ->  on add -> on success block to fetch records when a new record is submitted to the database. 


rec = Contact [ID != 0] sort by Added_Time range from 1 to 5;

where,

rec it is the name of the collection variable that contains form data.

Contact name of the form whose data has to be fetched. 

[ID !=0] is the criteria expression.

sort by Added_Time - the field based on which the records will be sorted. Here, Added_Time is the Deluge variable, which returns the time when the record was added. 

range from 1 to 5 - range enables you to limit the records fetched within the start index (x) and end index (y). If range is not specified, all the records in the form that satisfy the given criteria, will be fetched.


In the Script Builder UI, drag-n-drop the Fetch Records task and click on 
Edit, to specify the Sort column and Range in the Fetch records dialog, as shown in the screen-shot given below:



The Edit dialog to specify the sort field, the sort order and range will be displayed. Specify the values and click Done.



    • Related Articles

    • How can I fetch all the records in a form?

      To fetch all the records in a form, specify the criteria as [ID != 0], where ID is a auto-generated field that contains a unique value for each record in the form. Example:  rec = Contact [ID != 0] sort by Added_Time range from 1 to 5; where, rec it ...
    • How can I fetch records from another application

      The Fetch Records statement in Deluge Scripting currently supports fetching data from a form and updating it in another form, within the same application. Fetch and update of data from different applications can be achieved by using Functions. Refer ...
    • How can I fetch all the records in a Form that satisfy a given criteria?

      The Count function in Deluge Scripting enables you to get the total number of records in a form satisfying a given criteria. Using the count function, you can check if an entry already exists in a database.  Deluge Script  Assume, you have two forms ...
    • How can I fetch all the records in a Form that satisfy a given criteria?

      The Count function in Deluge Scripting enables you to get the total number of records in a form satisfying a given criteria. Using the count function, you can check if an entry already exists in a database.  Deluge Script  Assume, you have two forms ...
    • Search Records

      The search option helps with locating specific information or specific records without having to go through the entire list of records, thus saving time in finding records. The different search options available in Zoho Recruit are: Search by ...