Data Access - Fetch Records

Data Access - Fetch Records

This guide will help you with the following:
  1. Overview
  2. Return
  3. Syntax
  4. Things to keep in mind
  5. Examples

Overview

The fetch record deluge task retrieves records from a specified form, when a given criteria is met.
The criteria is mandatory.
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 collection of records.

Syntax

To fetch records which meet a criteria
  1. <variable> = <form_link_name>[<criteria>];
To fetch records which meet a criteria, and sort them in ascending order based on a field
  1. <variable> = <form_link_name>[<criteria>] sort by <field_link_name>;
To fetch records which meet a criteria, and sort them in descending order based on a field
  1. <variable> = <form_link_name>[<criteria>] sort by <field_link_name> desc;
To fetch records within a specified range, which meet a criteria
  1. <variable> = <form_link_name>[<criteria>] range from <start_index> to <end_index>;  
To fetch records within a specified range, which meet a criteria, and sort them in ascending order based on a field
  1. <variable> = <form_link_name>[<criteria>] sort by <field_link_name> range from <start_index> to <end_index>;
To fetch records within a specified range, which meet a criteria, and sort them in descending order based on a field
  1. <variable> = <form_link_name>[<criteria>] sort by <field_link_name> desc range from <start_index> to <end_index>;

Things to keep in mind

  1. If you wish to fetch all records of the specified form, use the following script as criteria:
  1. [ID != 0]
  1. It is advisable to fetch all records only when absolutely needed. Fetching all records generates a load resulting in performance issues.
  2. If you wish to use the "sort" and "range" parameters together, the "sort" parameter should be followed by the "range" parameter.
  3. If specifying the Name or Address field in the criteria, it is mandatory to specify their subfields as shown below:
    1. Name.first_name
    2. Name.last_name
    3. Name.prefix
    4. Name.suffix
    5. Address.address_line_1
    6. Address.address_line_2
    7. Address.district_city
    8. Address.state_province
    9. Address.postal_Code
    10. Address.country
    11. Address.longitude
    12. Address.latitude  

If more than one Name fields are present in the form, the link names of the subsequent name sub fields will be appended by a number starting from 1. So, if we take the example of the subfield <field>.prefix, the link name of the first such field will be <field>.prefix, the link name of the second such field will be <field>.prefix1, the link name of the third such field will be <field>.prefix2, and so on. The same logic applies to the Address subfields.
 
  1. The Name and Address fields do not work with the sort by param
This task can be used in the following events

Examples

1) The following snippet can be used to extract specified field value from the most recently added record.
  1. EmployeeDetails = Employees [ ID != 0] sort by Added_Time desc;
  2. info EmployeeDetails.<field_link_name>;   // picks up the first record from the collection
2) The following script fetches all records which have the "age" field value as "25", from the Employees form.
  1. EmployeeDetails = Employees [ age == "25" ];
3) The following script fetches all records which have the "name" field value as "Edward Thomas" or "Robert Frost", from the Poets_Form form.

poets = {"Edward Thomas", "Robert Frost"};
Poet_Details = Poets_Form [ name in poets ];
4)The following script fetches all records which have the "name" field value as "Jon Berryman". The name value is then updated to "John Berryman".

EmployeeDetails = Employee[name == "Jon Berryman"];
for each employee in EmployeeDetails
{
employee.name = "John Berryman" ;  
}
5) The following script fetches all records(because no record will have ID as 0) and sorts them by their Names. The Range is specified as 0 to 2, hence only the first 3 records will be fetched.

EmployeeDetails = Employee[ID != 0] sort by name range from 0 to 2;


    Zoho CRM Training Programs

    Learn how to use the best tools for sales force automation and better customer engagement from Zoho's implementation specialists.

    Zoho CRM Training
      Redefine the way you work
      with Zoho Workplace

        Zoho DataPrep Personalized Demo

        If you'd like a personalized walk-through of our data preparation tool, please request a demo and we'll be happy to show you how to get the best out of Zoho DataPrep.

        Zoho CRM Training

          Create, share, and deliver

          beautiful slides from anywhere.

          Get Started Now


            Zoho Sign now offers specialized one-on-one training for both administrators and developers.

            BOOK A SESSION








                                You are currently viewing the help pages of Qntrl’s earlier version. Click here to view our latest version—Qntrl 3.0's help articles.




                                    Manage your brands on social media

                                      Zoho Desk Resources

                                      • Desk Community Learning Series


                                      • Digest


                                      • Functions


                                      • Meetups


                                      • Kbase


                                      • Resources


                                      • Glossary


                                      • Desk Marketplace


                                      • MVP Corner


                                      • Word of the Day


                                        Zoho Marketing Automation

                                          Zoho Sheet Resources

                                           

                                              Zoho Forms Resources


                                                Secure your business
                                                communication with Zoho Mail


                                                Mail on the move with
                                                Zoho Mail mobile application

                                                  Stay on top of your schedule
                                                  at all times


                                                  Carry your calendar with you
                                                  Anytime, anywhere




                                                        Zoho Sign Resources

                                                          Sign, Paperless!

                                                          Sign and send business documents on the go!

                                                          Get Started Now




                                                                  Zoho TeamInbox Resources



                                                                          Zoho DataPrep Resources



                                                                            Zoho DataPrep Demo

                                                                            Get a personalized demo or POC

                                                                            REGISTER NOW


                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now







                                                                                            You are currently viewing the help articles of Sprints 1.0. If you are a user of 2.0, please refer here.

                                                                                            You are currently viewing the help articles of Sprints 2.0. If you are a user of 1.0, please refer here.



                                                                                                  • Related Articles

                                                                                                  • Data Access - Criteria to fetch records

                                                                                                    This guide will help you with the following: 1. Overview 2. Syntax 3. Applicable operators for different datatypes Overview A criteria is required when you need to fetch a collection of records. Criteria comprises of one or more conditions separated ...
                                                                                                  • Data Access - Update records

                                                                                                    This guide will help you with the following: Overview Syntax Applicable data-type and expression for each field Things to keep in mind Example Overview The update records deluge task updates(replaces) the value of a specified field with the given ...
                                                                                                  • Data Access - Delete records

                                                                                                    This guide you with the following: Overview Syntax Things to keep in mind Examples Overview The delete record deluge task deletes a form's records which meet a given criteria. The criteria is mandatory. Syntax delete from ...
                                                                                                  • Data Access - Add Records

                                                                                                    This guide will help you with the following: Overview Return Syntax Things to keep in mind Applicable data-type and expression for each field Example Overview The add record deluge task creates a new record with given values in the specified form. ...
                                                                                                  • Data Access - Fetch a field's value

                                                                                                    This guide will help you with the following: Overview Return Syntax Things to keep in mind Example 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 ...
                                                                                                    Wherever you are is as good as
                                                                                                    your workplace

                                                                                                      Resources

                                                                                                      Videos

                                                                                                      Watch comprehensive videos on features and other important topics that will help you master Zoho CRM.



                                                                                                      eBooks

                                                                                                      Download free eBooks and access a range of topics to get deeper insight on successfully using Zoho CRM.



                                                                                                      Webinars

                                                                                                      Sign up for our webinars and learn the Zoho CRM basics, from customization to sales force automation and more.



                                                                                                      CRM Tips

                                                                                                      Make the most of Zoho CRM with these useful tips.



                                                                                                        Zoho Show Resources