Overview
The fetch record deluge task retrieves records from a specified form, when 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 all the values of a specified field. The return type is List.
Syntax
To fetch all values of a specified field from the records which meet the criteria
- <variable> = <form_link_name>[<criteria>].<field_link_name>.getall();
To fetch all values of a specified field from all the records, 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>.getall();
To fetch all values of a specified field from all the records 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> desc.getall();
To fetch all values of a specified field from all the records in a specified range, which meet the criteria
- <variable> = <form_link_name>[<criteria>].<field_link_name>range from <start_index> to <end_index>.getall();
To fetch all values of a specified field from 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>. getall();
To fetch all values of a specified field from 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>. getall();
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 ids' of all the records which have the designation as "Member Technical Staff". The record ids' are then added to the Employee_Name lookup field.
- EmployeeName = Employee[Designation == "Member Technical Staff"].ID.getall();
- Employee_Name:ui.add(EmployeeName);