Skip to product menu
close
  • Recent Launches
    Press Space or Enter to display list of options
EXPLORE ALL PRODUCTS

Recent Launches

New

Payroll software with automated tax payments and filing.

Try now
New

Robotic process automation software to automate high-volume, rule-based tasks.

Try for free
New

Low-code IoT platform and solutions for connected businesses.

Try now
New

Business formation service to launch and grow your businesses.

Try now
New

Privacy-friendly application analytics solution.

Try for free

Sales

 
CRM

Comprehensive CRM platform for customer-facing teams.

CRM
 
Bigin

Simple CRM for small businesses moving from spreadsheets.

Bigin
 
Forms

Build online forms for every business need.

Forms
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Sign

Digital signature app for businesses.

Sign
 
RouteIQ

Comprehensive sales map visualization and optimal route planning solution.

RouteIQ
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
Suites
CRM Plus

Unified platform to deliver top-notch customer experience.

CRM Plus

Marketing

 
Social

All-in-one social media management software.

Social
 
Campaigns

Create, send, and track targeted email campaigns that drive sales.

Campaigns
 
Forms

Build online forms for every business need.

Forms
 
Survey

Design surveys to reach and interact with your audience.

Survey
 
Sites

Online website builder with extensive customisation options.

Sites
 
PageSense

Website conversion optimization and personalisation platform.

PageSense
 
Backstage

End-to-end event management software.

Backstage
 
Webinar

Webinar platform for webcasting online webinars.

Webinar
 
Marketing Automation

All-in-one marketing automation software.

Marketing Automation
 
LandingPage

Smart landing page builder to increase conversion rates

LandingPage
 
Publish

Manage all your local business listings on a single platform.

Publish
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Sign

Digital signature app for businesses.

Sign
 
Thrive

Complete loyalty and affiliate management platform.

Thrive
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
LeadChain

Sync, manage, and convert leads across channels seamlessly.

LeadChain
 
NEW
CommunitySpaces

Online community platform for individuals and businesses to grow their network and brand.

CommunitySpaces
 
Suites
Marketing Plus

Unified marketing platform for marketing teams.

Marketing Plus

Commerce and POS

 
Commerce

eCommerce platform to manage and market your online store.

Commerce

Service

 
Desk

Helpdesk software to deliver great customer support.

Desk
 
Assist

Remote support and unattended remote access software.

Assist
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
FSM

End-to-end field service management platform for service businesses.

FSM
 
SalesIQ

Live chat app to engage and convert website visitors.

SalesIQ
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
Suites
Service Plus

Unified platform for customer service and support teams.

Service Plus

Finance

 
Books

Powerful accounting platform for growing businesses.

Books
 
FREE
Invoice

100% Free invoicing solution.

Invoice
 
Expense

Effortless expense reporting platform.

Expense
 
Inventory

Powerful stock management and inventory control software.

Inventory
 
Billing

End-to-end billing solution for your business.

Billing
 
Checkout

Collect payments online with custom branded pages.

Checkout
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo
 
Practice

Practice management software for accounting firms.

Practice
 
Sign

Digital signature app for businesses.

Sign
 
Commerce

eCommerce platform to manage and market your online store.

Commerce
 
Suites
Finance Plus

All-in-one suite to manage your operations and finances.

Finance Plus

Email and Collaboration

 
Mail

Secure email service for teams of all sizes.

Mail
 
Meeting

Online meeting software for all your video conferencing & webinar needs.

Meeting
 
Writer

Word processor for focused writing and discussions.

Writer
 
Sheet

Spreadsheet software for collaborative teams.

Sheet
 
Show

Create, edit, and share slides with a sleek presentation app.

Show
 
Notebook

Beautiful home for all your notes.

Notebook
 
Cliq

Stay in touch with teams no matter where you are.

Cliq
 
Connect

Employee experience platform to communicate, engage, and build positive employee relations.

Connect
 
Bookings

Appointment scheduling app for consultations with customers.

Bookings
 
TeamInbox

Shared inboxes for teams.

TeamInbox
 
WorkDrive

Online file management for teams.

WorkDrive
 
Sign

Digital signature app for businesses.

Sign
 
Office Suite

Powerful collaborative work platform for teams.

Office Suite
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
Calendar

Online business calendar to manage events and schedule appointments.

Calendar
 
Learn

Knowledge and learning management platform.

Learn
 
Voice

Cloud Contact Center Software for businesses.

Voice
 
ToDo

Collaborative task management for individuals and teams.

ToDo
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
FREE
PDF Editor

Collaborative online PDF editing tool.

PDF Editor
 
Suites
Workplace

Application suite built to improve team productivity and collaboration.

Workplace

Human Resources

 
People

Organize, automate, and simplify your HR processes.

People
 
Recruit

Intuitive recruiting platform built to provide hiring solutions.

Recruit
 
Expense

Effortless expense reporting platform.

Expense
 
Workerly

Manage temporary staffing with an employee scheduling solution.

Workerly
 
NEW
Payroll

Payroll software with automated tax payments and filing.

Payroll
 
Shifts

Employee scheduling and time tracking app.

Shifts
 
Sign

Digital signature app for businesses.

Sign
 
Suites
People Plus

Comprehensive HR platform for seamless employee experiences.

People Plus

Security and IT Management

 
Creator

Build custom apps to simplify business processes.

Creator
 
Directory

Workforce identity and access management solution for cloud businesses.

Directory
 
FREE
OneAuth

Secure multi-factor authenticator (MFA) for all your online accounts.

OneAuth
 
Vault

Online password manager for teams.

Vault
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Toolkit

Complete resource for any admin-related lookup queries.

Toolkit
 
Lens

Interactive remote assistance software with augmented reality.

Lens
 
Assist

Remote support and unattended remote access software.

Assist
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA

BI and Analytics

 
Analytics

Modern self-service BI and analytics platform.

Analytics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep
 
NEW
IoT

Harnessing IoT analytics for real-time operational intelligence.

IoT

Project Management

 
Projects

Manage, track, and collaborate on projects with teams.

Projects
 
Sprints

Planning and tracking tool for scrum teams.

Sprints
 
BugTracker

Automatic bug tracking software for managing bugs.

BugTracker
 
NEW
Solo

The all-in-one toolkit for solopreneurs.

Solo

Developer Platforms

 
Creator

Build custom apps to simplify business processes.

Creator
 
Flow

Automate business workflows by creating smart integrations.

Flow
 
Catalyst

Pro-code platform to build and deploy your apps.

Catalyst
 
Office Integrator

Built in document editors for web apps.

Office Integrator
 
ZeptoMail

Secure and reliable transactional email sending service.

ZeptoMail
 
QEngine

Test automation software to build, manage, execute, and report testcases.

QEngine
 
Tables

Work management tool to connect people, processes, and information.

Tables
 
NEW
RPA

Automate manual, tedious, and repetitive tasks easily.

RPA
 
NEW
Apptics

Application analytics for all apps.

Apptics
 
Embedded BI

Embedded analytics and white label BI solutions, tailored for your needs.

Embedded BI
 
NEW
IoT

Build, deploy, and scale IoT solutions for connected businesses.

IoT
 
DataPrep

AI-powered data preparation service for your data-driven organization.

DataPrep

IoT

 
NEW
IoT

Low-code IoT platform and solutions for connected businesses.

IoT

Search Result

 
CRM Plus

Unified platform to deliver top-notch customer experience.

Try now
CRM Plus
 
Service Plus

Unified platform for customer service and support teams.

Try now
Service Plus
 
Finance Plus

All-in-one suite to manage your operations and finances.

Try now
Finance Plus
 
People Plus

Comprehensive HR platform for seamless employee experiences.

Try now
People Plus
 
Workplace

Application suite built to improve team productivity and collaboration.

Try now
Workplace
 
Marketing Plus

Unified marketing platform for marketing teams.

Try now
Marketing Plus
 
All-in-one suite

Zoho One

The Operating System for Business

Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.

TRY ZOHO ONE
Zoho One
Zoho Marketplace

With over 2000 ready-to-use extensions across 40+ categories, connect your favorite business tools with the Zoho products you already use.

EXPLORE MARKETPLACE
Marketplace

Join us for the biggest low-code event of the year. Register now!

x
Skip to main content

Choose where you’d like to start

Fetch records

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.

The criteria is mandatory.

See this page to learn about fetching all values of a field in a collection.

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 a collection of records.

Syntax

To fetch records which meet a criteria

<variable> = <form_link_name> [<criteria>];

To fetch records which meet a criteria, and sort them in ascending order based on a field

<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

<variable> = <form_link_name> [<criteria>] sort by <field_link_name> desc;

To fetch records within a specified range, which meet a criteria

<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

<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

<variable> = <form_link_name> [<criteria>] sort by <field_link_name> desc range from <start_index> to <end_index>;

ParameterDescription
<variable>Collection variable holding the collection of records.
<form_link_name>Link name of the form from which the records will be fetched.
<criteria>Criteria based on which records will be fetched. 
sort by <field_link_name>

Link name of the field based on which records will be sorted.

Note: A lookup field will sort the records based on the record ID.

range from <start_index> to <end_index>

Records included in the specified index range will be fetched.

<start_index>

Start index of the range of records to be fetched. 

Either 0 or 1 may be specified as the index number of the first record when used in <start_index> param.
If 0 is the specified start index, the last index is numbered from 0. If 1, or any number greater than 1, is the specified start index, the last index is numbered from 1.

E.g. for records A (index 1), B (index 2), C (index 3), D (index 4), and E (index 5):

Range from 0 to 3 will fetch A, B, C, D
Range from 1 to 4 will fetch A, B, C, D
Range from 2 to 4 will fetch B, C, D

<end_index>Last index of the range of records to be fetched, inclusive.

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.
     

  • If you wish to use the "sort" and "range" parameters together, the "sort" parameter should be followed by the "range" parameter.
     
  • If specifying the Name or Address field in the criteria, it is mandatory to specify their subfields as shown below:
    • Name.first_name
    • Name.last_name
    • Name.prefix
    • Name.suffix
    • Address.address_line_1
    • Address.address_line_2
    • Address.district_city
    • Address.state_province
    • Address.postal_Code
    • Address.country
    • Address.longitude
    • ​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.
       
  • 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

Examples

1) The following snippet can be used to extract specified field value from the most recently added record.

EmployeeDetails = Employees [ ID != 0] sort by Added_Time desc;
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.

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;

Limitations due to behavioral updates

The following limitations are applicable to this task. To know about more such limitations, you can check this page.

  • Sort using multi select fields: Records fetched using this task cannot be sorted using  Multi Select, Multi Select lookup, Existing Subform, Inline Subform, or Check Box fields. For example, the below line of code will throw an error.

    variable = Form1[ID !=0] sort by checkbox_field ;
  • Sort using composite fields: Records fetched using this task cannot be sorted using the Name and Address composite fields and Added_Location and Modified_Location composite system fields. For example, the below line of code will throw an error.

    variable = Form1[ID !=0] sort by name ;
  • Fetch records criteria restriction: The left expression of the fetch records task criteria with the format <parent field>.<child field> cannot contain the following field types i.e., they cannot contain the format as MultiSelect.MultiSelect.
    • parent field - Multi Select Lookup, Existing Subform, and Inline Subform
    • child field - Multi Select field, Multi Select Lookup, Existing Subform, Inline Subform, Multi Select,  and Check Box fields.

      For example, the below line of code will throw an error.

      variable = Form1[multi_select_lookup_field.multiselect_field == {"Choice 1", "Choice 2"}] ;

      The following method is the best practice to achieve the use case:

      fetchedIDs = Form2[multiselect_field IN {"Choice 1", "Choice 2"}].ID.getAll();
      
      variable = Form1[multi_select_lookup_field in fetchedIDs];
  • Fetch records criteria restriction (using composite fields): The left and right expressions (operands) of the fetch records task criteria cannot contain the Name and Address composite fields and composite system fields such as Added_Location and Modified_Location. For example, the below lines of code will throw an error during script execution. This restriction applies only when the above-mentioned fields are present in the same form.

    variable = Form[ Name == Name ];
    variable = Form[ Address == Address ];
  • Fetch records criteria restriction (Multi Select and Single Select fields): A Multi Select field type cannot be compared with a single select field type in the left and right expressions (operands) of the fetch records task criteria i.e., the two operands cannot contain the following fields in each of the two field types.
    • Multi Select field type - Multi Select Lookup, Existing Subform,  Inline Subform, Multi Select,  and Check Box fields.
    • Single Select field type - Radio, Drop Down, Drop Down Lookup, and Radio Lookup fields.

      For example, the below lines of code will throw an error during script execution.

      variable = Form[ MultiSelect == Radio ];
      variable = Form[ MultiSelectLookup == SingleSelectLookup ];
  • Fetch records criteria restriction (Multi Select fields): The left and right expressions of the fetch records task criteria cannot contain the following Multi Select field types:
    • Lookup (Multi Select)
    • Existing Subform
    • Inline Subform
    • Check Box

      For example, the below lines of code will throw an error during script execution.

      variable = Form[ MultiSelectLookup == MultiSelect ];
      variable = Form[ MultSelectField1 == MultSelectField2 ];
      variable = Form[ SubForm == SubForm ];
  • Operator-based criteria restriction: The left expressions of the fetch records task criteria cannot contain the following Multi Select field types and the right expressions cannot contain more than six elements in the list (here, arguments refer to choices related to the Multi Select fields).
    • Multi Select
    • Lookup (Multi Select)
    • Existing Subform
    • Inline Subform
    • Check Box

      For example, the below line of code will throw an error.

      rec = Form[ MultiSelect == {"Choice 1", "Choice 2", "Choice 3", "Choice 4", "Choice 5", "Choice 6", "Choice 7"} ];
      rec = Form[ MultiSelect IN {"Choice 1", "Choice 2", "Choice 3", "Choice 4", "Choice 5", "Choice 6", "Choice 7"} ];
  • contains() function criteria restriction: Records fetched using the fetch records task cannot contain more than one searchString in the contains() function used as a criteria. This restriction is applicable when the criteria are specified for the following Creator fields:
    • Multi Select
    • Check Box
    • Multi Select Lookup
    • Subform
    • SingleSelect_Lookup.MultiSelectField - when you've used a single select lookup field (dropdown or radio) that looks up data from a multi select field in the parent form.

      For example, the below line of code will throw an error during script execution since two searchStrings are specified in the criteria.

      rec = Form[ MultiSelect.contains({"Choice 1", "Choice 2"}) ];

      The following method is the best practice to achieve the use case:

      rec = Form[ MultiSelect.contains("Choice 1") && MultiSelect.contains("Choice 2")  ];

Related Links

Get Started Now

Execute