Fetch a field's value
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 a given criteria is met.
This page will explain how to fetch a specified field's value from the first record in the collection of records.
See this page to learn about fetching all values of a field in a 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 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
To fetch a specified field's value from the first record of all the records sorted in ascending order, which meet the criteria
To fetch a specified field's value from the first record of all the records sorted in descending order, which meet the criteria
To fetch a specified field's value from the first record of all the records in the specified range, which meet the criteria
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
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
Parameter | Description | |||||
---|---|---|---|---|---|---|
<variable> | Variable holding the specified field's value | |||||
<form_link_name> | Link name of the form from which the records will be fetched. | |||||
<criteria> | Criteria based on which the records will be fetched. | |||||
[<criteria>].<field_link_name> | Link name of the field whose value has to 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 return 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. - 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
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 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;
2) The following script fetches the value of a checkbox field and iterates through all the selected values.
selected_values = test[ID == 128976000000008013].Checkbox; for each val in selected_values { info val; }