Choose where you’d like to start

Fetch all values of a field

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

<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();
ParameterDescription
<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.

<start_index>

Start index of the range of records to be fetched.

Both, 0 and 1 are considered as the first index number when used in <start_index> param.

<end_index>

Last index of the range of records to 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 LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Created or Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Edited
On LoadYes
On ValidateYes
On SuccessYes
On User inputYes
Subform on add rowYes
Subform on delete rowYes
When a record is Deleted
On ValidateYes
On SuccessYes
Other workflow events
On a scheduled dateYes
During approval processYes
During payment processYes
In a Custom FunctionYes
In an Action item in reportYes

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); 

Get Started Now

Execute