Data Access - Criteria to fetch records

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 by logical operators. 
Conditions always evaluate to a boolean value - True or False. The boolean value of the overall criteria will depend on the conditions and the type of Logical Operators used to connect the conditions in the criteria.
If the criteria is met(i.e., it evaluates to true), all the records which meet the criteria will be fetched.

Syntax

A criteria looks like the following snippet:
  1. (<condition_1> <logical_operator_1> <condition_2> <logical_operator_2> ..... <condition_n>)
Each condition comprises of the following:
  1. (<field_link_name> <operator> <expression>)

For example:
  1. (email == "tony@zylker.com" &&  phone == "+91xxxxxxxxxx")
  2. // 'email' and 'phone' are the form fields
  3. // in the example, we have 2 conditions separated by the && logical operator
  4. // each condition has a field, an operator, and the expression to be compared
  5. // such conditions can be used to fetch records which meet the criteria

Applicable Operators for different data types

1. Applicable operators and expressions for Name and Address field types.
The criteria format: <field_link_name> <operator> (<expression>) must be used to specify the following operators.

The criteria format: <field_link_name>.<operator> (<expression>) must be used to specify the following operators.

2. Applicable operators and expressions for Name(subfields), Email, Address(subfields), Single Line, Multi Line, Drop down, Radio, Formula (String), Rich Text, Phone Number, URL, Image, File Upload, Audio, Video, Signature, Users, Added User, Modified User, and Integration field types
The criteria format: <field_link_name> <operator> <expression> must be used to specify the following operators.

The criteria format: <field_link_name>.<operator> (<expression>) must be used to specify the following operators.


Note:
  1. The subfields for Name field type must be specified in the format:
    1. <field_link_name>.prefix
    2. <field_link_name>.first_name
    3. <field_link_name>.last_name
    4. <field_link_name>.suffix
  2. The subfields for Address field type must be specified in the format:
    1. <field_link_name>.address_line_1
    2. <field_link_name>.address_line_2
    3. <field_link_name>.district_city
    4. <field_link_name>.state_province
    5. <field_link_name>.postal_code
    6. <field_link_name>.country
    7. <field_link_name>.longitude
    8. <field_link_name>.latitude
  3. If more than one Name fields are present in the form, the link names of the subsequent 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.
  4. Similarly, if more than one Address fields are present in the form, the link names of the subsequent sub fields will be appended by a number starting from 1. So, if we take the example of the subfield <field>.country, the link name of the first such field will be <field>.country, the link name of the second such field will be <field>.country1, the link name of the third such field will be <field>.country2, and so on. 
  5. For Rich Text field type, the string value must be provided with the applicable html tags, if any.
  6. For Phone Number field type, the string value must be provided along with the country code.
  7. For URL with title, linkname and target as "new window". If these properties are not enabled, they can be removed from the url format.
    1. "<a href= \"<URL>\" title = \"<TITLE>\" target = \"_blank\"><linkname></a>"
  8. For Image with linkname, title, and target as "new window". If these properties are not enabled, they can be removed from the url format.
    1. "<a href= \"http://<LINKNAME>\" title =\"<TITLE>\" target = \"_blank\"><img src = \"<URL>\" title =\"<TITLE>\"></img></a>"
  9. For File upload field type, the string value must be in the format:
    1. <file-id>_<file-name>.<file-type>             
    2. // The file-id is a unique id assigned to each file. Execute the info statement to view the exact format of the value as stored in the database.
  10. For Audio and Video field types, The string value must be in the format:
    1. <file-id>_<file-size-in-bytes>_<file-name>.<file-type>     
    2. // The file-id is a unique id assigned to each file. Execute the info statement to view the exact format of the value as stored in the database.
  11. For Signature field type, The string value must be in the format:
    1.  <file-id>_<field-link-name>.png               
    2. // The file-id is a unique id assigned to each file. Execute the info statement to view the exact format of the value as stored in the database.
  12. For Users, Added user and Modified user, you can check the list of users and their email addresses from the Users section in your application. To check with the email address of the users, specify <field_link_name> in the following format:
    1. <field_link_name>.email // will work only for the Users field type and for the operators: ==, !=, is, and is not.
  13. For Integration field type, you need to specify the record id.

3. Applicable operators and expressions for Number, Autonumber, Percent, Currency, Decimal, ID and Formula(bigint/decimal) field types
The criteria format: <field_link_name> <operator> <expression> must be used to specify the following operators.

The criteria format: <field_link_name>.<operator> (<expression>) must be used to specify the following operators.

4. Applicable operators and expressions for Date, Date-time, Added Time and Modified Time field types
The criteria format: <field_link_name> <operator> <expression> must be used to specify the following operators.

5. Applicable operators and expressions for decision box field type
The criteria format: <field_link_name> <operator> <expression> must be used to specify the following operators.

6. Applicable operators and expressions for multi select and checkbox field types
The criteria format: <field_link_name> <operator> <expression> must be used to specify the following operators.

The criteria format: <field_link_name>.<operator> (<expression>) must be used to specify the following operators.

7. Applicable operators and expressions for Lookup - Multiselect and Checkbox field types
The criteria format: <field_link_name> <operator> <expression> must be used to specify the following operators.

The criteria format: <field_link_name>.<operator> (<expression>) must be used to specify the following operators.

8. Applicable operators and expressions for Lookup - Drop-down and Radio field types
The criteria format: <field_link_name> <operator> <expression> must be used to specify the following operators.

The criteria format: <field_link_name>.<operator> (<expression>) must be used to specify the following operators.


Note
  1. Lookupsubfields and Subform fields
    1. You can specify fields in the lookup form in the format: <lookup_field_link_name>.<field_link_name> and the operators and expressions must be specified based on the field type of the <field_link_name>, as mentioned in the above tables
    2. You can specify fields in the Subform in the format: <subform_field_link_name>.<field_link_name> and the operators and expressions must be specified based on the field type of the <field_link_name>, as mentioned in the above tables
  2. Encrypted fields 
    1. The following are the only applicable operators and built-in functions for fields whose data encryption is enabled: ==, !=, and isEmpty().


    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 - Fetch Records

                                                                                                    This guide will help you with the following: Overview Return Syntax Things to keep in mind 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 ...
                                                                                                  • 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 - 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 - 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 ...
                                                                                                  • Data Access - Fetch all values of a field

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