Search Records in SkyDesk CRM

Overview

SkyDesk Creator and SkyDesk CRM have been integrated for efficient usability purposes. We have developed tasks in SkyDesk Creator to perform automatic actions in SkyDesk CRM, which would otherwise require manual execution. For example, you can search for records in SkyDesk CRM by specifying a criteria and populate them in SkyDesk 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 SkyDesk 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>, [<from_index>],[<to_index>]);

where,

Params  Description

<response> 

is the response returned as LIST by SkyDesk CRM.

<module_name> 

is the 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 (OR) =
  • <>
  • contains(*srcString*)
  • starts with(srcString*)
  • ends with(*srcString)
  • doesn't contain
  • < (OR) is before
  • > (OR) is after
  • <= (OR) lesser than or equals
  • => (OR) greater than or equals

Note:

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

<from_index>

  (optional)

is the starting index of the records that need to be fetched. It is of NUMBER datatype.

<to_index>

  (optional)

is the last index of the records that need to be fetched. It is of NUMBER datatype.

Note:

  • If only fromIndex is mentioned, 20 records will be fetched starting from mentioned startIndex.
  • If only toIndex is mentioned, 20 records will be fetched ending with specified toIndex.
  • If both are not mentioned, first 20 records will be fetched.
  • At any given time, a maximum of 200 records can be fetched.

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 CustomModule1. To achieve this, add the following script in the required Form Actions block of your SkyDesk Creator Form:

response=zoho.crm.searchRecords("CustomModule1", "(Email|=|john@zillum.com)");

where,

response
is the response returned as   map  by SkyDesk CRM. The fetched records will be contained in the response. Check sample response here.
"CustomModule1"
is the label name of SkyDesk CRM Custom Module, of string datatype, where the records will be searched.
"(Email|=|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 SkyDesk Creator Form:

response=zoho.crm.searchRecords("Accounts", "(Account Name|starts with|A*)");

where,

response
is the response returned as   map  by SkyDesk CRM. The fetched records will be contained in the response. Check sample response here.
"Accounts"
is the label name of SkyDesk 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:

{
"SIC Code":"0",
"Account Owner":"Test",
"Employees":"0",
"Account Name":"Test",
"Account Number":"0",
"Created By":"Test",
"ACCOUNTID":"231356000000043001","MODIFIEDBY":"231356000000034003",
"Annual Revenue":"0",
"Created Time":"2010-07-06 10:15:01",
"Modified By":"Test",
"SMOWNERID":"231356000000084003",
"SMCREATORID":"231356000000034003",
"Modified Time":"2011-11-21 10:00:14"
}

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.

Related Links