Overview
The fetch record deluge task retrieves records from a specified form, when a given criteria is met.
Note:
The fetched records may appear to be sorted based on "added time" (oldest first) system field. However, there is no guarantee to this order and there is no guarantee that the order will remain constant over time. If you are particular about the sequence of the records, it is advisable to use the sort param.
Return
This task returns a specified field's value from the first record in a collection.The returned field value can be put to further use like updating it.
Syntax
To fetch a specified field's value from the first record which meets the criteria
- <variable> = <form_link_name>[<criteria>].<field_link_name>;
To fetch a specified field's value from the first record of all the records sorted in ascending order, which meet the criteria
- <variable> = <form_link_name>[<criteria>].<field_link_name>sort by <field_link_name>;
To fetch a specified field's value from the first record of all the records sorted in descending order, which meet the criteria
- <variable> = <form_link_name>[<criteria>].<field_link_name> sort by <field_link_name> desc;
To fetch a specified field's value from the first record of all the records in the specified range, which meet the criteria
- <variable> = <form_link_name>[<criteria>].<field_link_name> range from <start_index> to <end_index>;
To fetch a specified field's value from the first record of all the records in the specified range sorted in ascending order based on a field, which meet the criteria
- <variable> = <form_link_name>[<criteria>].<field_link_name>sort by <field_link_name>range from <start_index> to <end_index>;
To fetch a specified field's value from the first record of all the records in the specified range sorted in descending order based on a field, which meet the criteria
- <variable> = <form_link_name>[<criteria>].<field_link_name>sort by <field_link_name> descrange from <start_index> to <end_index>;
Things to keep in mind
- If you wish to fetch all records of the specified form, use the following script as criteria:
- It is advisable to fetch all records only when absolutely needed. Fetching all records generates a load resulting in performance issues.
- If you wish to use the "sort" and "range" parameters together, the "sort" parameter should be followed by the "range" parameter.
- The Name and Address fields do not work with the sort by param.
This task can be used in the following events
Example
1) The following script fetches the value of the "name" field from the record which appears at the top after the records have been sorted based on the age field.
- EmployeeDetails = Employee[ID != 0 ].name sort by age;