Fetch all values of a field
Table of Contents
Note:
- This task is applicable only to Zoho Creator.
Overview
The fetch record deluge task retrieves records from a specified form, when given criteria is met.
This page will explain how to fetch all the values of a specified field from a collection of records.
See this page to learn about fetching a specified field's value from the first record in the collection.
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
To fetch all values of a specified field from all the records, sorted in ascending order based on a field, which meet the criteria
To fetch all values of a specified field from all the records sorted in descending order based on a field, which meet the criteria
To fetch all values of a specified field from all the records in a specified range, which meet the criteria
Parameter | Description | |||||
---|---|---|---|---|---|---|
<variable> | Variable holding all values of a specified field. | |||||
<form_link_name> | Link name of the form from which the records will be fetched. | |||||
<criteria> | Criteria based on which records will be fetched. | |||||
(criteria).<field_link_name> | Link name of the field whose value will be retrieved. | |||||
sort by <field_link_name> | Link name of the field based on which records will be sorted.
| |||||
range from <start_index> to <end_index> | Records falling in the specified index range will be fetched.
Negative index values will result in a runtime error. |
Things to keep in mind
- If you wish to fetch all records of the specified form, use the following script as criteria[ID != 0]
It is advisable to fetch all records only when absolutely needed. Fetching all records generates a load resulting in performance issues. - The Name and Address fields do not work with the sort by param.
This task can be used in the following events
When a record is Created | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Created or Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Edited | ||
On Load | Yes | |
On Validate | Yes | |
On Success | Yes | |
On User input | Yes | |
Subform on add row | Yes | |
Subform on delete row | Yes | |
When a record is Deleted | ||
On Validate | Yes | |
On Success | Yes | |
Other workflow events | ||
On a scheduled date | Yes | |
During approval process | Yes | |
During payment process | Yes | |
In a Custom Function | Yes | |
In an Action item in report | Yes |
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.
Employee_Name:ui.add(EmployeeName);