Search Records in Zoho CRM

Search Records in Zoho CRM

Overview

Zoho Creator and Zoho CRM have been integrated for efficient usability purposes. We have developed tasks in Zoho Creator to perform automatic actions in Zoho CRM, which would otherwise require manual execution. For example, you can search for records in Zoho CRM by specifying a criteria and populate them in Zoho Creator Form fields for further action. You can specify the Module Name in which you want to search the records along with the optional start and end index numbers. This can be achieved using zoho.crm.searchRecords() task in Zoho Creator.

Use Case Scenario

Let's say we need to fetch all records having email id as john@zillum.com from a custom module. This can be achieved by using the searchRecords()task with the specified criteria and module name. Further details on how to execute this task are explained below.

Syntax

<response>=zoho.crm.searchRecords(<module_name>, <criteria>, [<page>],[<per_page>], <connections>);

where,

Params Description

<response> 

is the response returned as LIST by Zoho CRM.

<module_name> 

is the API name of the CRM module, of STRING datatype, where the records will be searched for. Following is the list of supported modules.

Leads

Potentials

Products

Contacts

Campaigns

Vendors

Accounts

Cases

Quotes

Sales_Orders

Purchase_Orders

Invoices

<criteria> 

is a conditional statement of the following format: (<colName> : <operator> : <colValue>). The <colName> stands for the CRM field label name and <colValue> stands for it's respective value. The <operator>  can contain the following:

  • equals
  • starts_with

Note:

  • If a column contains null values, zoho.crm.searchRecords DOES NOT report them in a <> statement.

<page>

  (optional)

To get the list of records based on pages. It is of the NUMBER datatype. Default: 1.

<per_page>

  (optional)

Used to get the list of records available per page. It is of the NUMBER datatype. Default: 200.

<connections> 

  (optional)

Displays the connectors associated with the function. Datatype is STRING.


Example 1: Search records with a specific email address in a Custom Module

Let's say we need to fetch all records having email address as john@zillum.com from a Custom Module named Hotels. To achieve this, add the following script in the required workflow section of your Zoho Creator Form:

response=zoho.crm.searchRecords("Hotels", "(Email:equals:john@zillum.com)");

where,

response
is the response returned as map by Zoho CRM. The fetched records will be contained in the response. Check sample response here.
"Hotels"
is the API name of Zoho CRM Custom Module, of string datatype, where the records will be searched.
"(Email:equals:john@zillum.com)"
is the criteria.

Example 2: Search Accounts which start with a specific letter

Let's say we need to fetch all Accounts which start with the letter "A". To achieve this, add the following script in the required Form Actions block of your Zoho Creator Form:

response=zoho.crm.searchRecords("Accounts", "(Account_Name:starts_with:A)");

where,

response
is the response returned as map by Zoho CRM. The fetched records will be contained in the response. Check sample response here.
"Accounts"
is the label name of Zoho CRM Accounts Module, of string datatype, where the records will be searched.
"(Account_Name:starts_with:A)"
is the criteria.

Response Format

The response returned is of the following format:

{  
   "Owner":{  
      "name":"Ben",
      "id":"2938383000000132011"
   },
   "Company":"Zillum",
   "Email":"bruce.wills@zillum.com",
   "Description":null,
   "Discount":null,
   "$currency_symbol":"$",
   "Total_Amount":null,
   "Rating":null,
   "Website":null,
   "Twitter":null,
   "Salutation":null,
   "Last_Activity_Time":null,
   "First_Name":null,
   "Full_Name":"Wills",
   "Lead_Status":null,
   "Industry":null,
   "Modified_By":{  
      "name":"Ben",
      "id":"2938383000000132011"
   },
   "Skype_ID":null,
   "$converted":false,
   "$process_flow":false,
   "Phone":"+1 678 904 1854",
   "Street":null,
   "Zip_Code":null,
   "id":"2938383000000399001",
   "Email_Opt_Out":false,
   "$approved":true,
   "Designation":null,
   "$approval":{  
      "delegate":false,
      "approve":false,
      "reject":false,
      "resubmit":false
   },
   "Modified_Time":"2018-03-28T11:34:40+05:30",
   "Created_Time":"2018-03-28T11:34:40+05:30",
   "$converted_detail":{  

   },
   "$followed":false,
   "$editable":true,
   "City":null,
   "No_of_Employees":0,
   "Mobile":null,
   "Last_Name":"Wills",
   "State":null,
   "Total":0,
   "Lead_Source":null,
   "Country":"United States",
   "Tag":[  

   ],
   "Created_By":{  
      "name":"Ben",
      "id":"2938383000000132011"
   },
   "Fax":null,
   "Annual_Revenue":0,
   "Secondary_Email":null
}

Limitation

CRM Tasks can be executed only in accounts which are under Flexible and Unlimited Plans. Accounts under Free Plan, kindly upgrade to use CRM tasks. For more details scroll down to Integration and Web Data on the pricing page.

Script Builder

You can also make use of Script builder to define the zoho.crm.searchRecords() task. Navigate to your application’s Workflow and drag and drop the Call Function under Deluge Tasks > Miscellaneous. Select Integration tasks and fill out necessary information.

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocreator.com