Creator help

Get Records by Id from 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 fetch a record from Zoho CRM and have it populated in a Zoho Creator form field by simply specifying the record id. This can be achieved using zoho.crm.getRecordById() task in Zoho Creator.

Use Case Scenario

Let's say we have a Zoho Creator Form which is used to identify the Lead Owner by specifying the Lead. In this case, the Lead details are fetched using the Lead Id and populated in the form fields. Further details on how to execute this task are explained below.

Syntax

<response> =zoho.crm.getRecordById(<module_name>, <record_ID>);

where,

Params Description

<response> 

is the response returned as MAP by Zoho CRM.

<module_name> 

is the name of the CRM module, of STRING datatype, from where the records will be fetched. Following is the list of supported modules.

Leads

Potentials

Products

Contacts

Campaigns

Vendors

Accounts

Cases

Quotes

Sales Orders

Purchase Orders

Invoices

<record_Id>

is the id the record, of Number datatype, that needs to be fetched.

Example: Fetch a Lead record by specifying it's id

Let's assume we have a Zoho Creator Form with the following fields:

  • Lead_ID (Zoho CRM Leads field type)
  • Lead Owner (Single Line field type)

Add the following script in Field Actions > Lead_ID > On User Input to fetch Lead Owner of the specified Lead ID and set it as a Form field value:

response = zoho.crm.getRecordById("Leads", input.Lead_ID); 

input.Lead_Owner= response.get( "Lead Owner" ) ;

where,

response
is the map returned as map by Zoho CRM containing the details of the specified Lead.
"Leads"
stands for the Leads module, of string datatype.
input.Lead_ID 
input.Lead_Owner
refers to the Form fields input.
"Lead Owner"
is the Zoho CRM field label name, of string datatype.

Response Format

The response returned is of the following format:

[ {"Lead Owner":"Test","Phone":"34567","LEADID":"231356000000121001","Country":"country","City":"city", "Created
By":"test","No of Employees":"0","MODIFIEDBY":"231356000000034003","Annual Revenue":"0","Email":
"test@gmail.com","Created Time":"2012-03-12 18:33:48","Modified By":"sampleapp","SMOWNERID":"231356000000 034003"
,"SMCREATORID":"231356000000034003","Email Opt Out":"false","Company":"test","Last Name":"test","First Name"
:"test","Modified Time":"2012-03-12 18:33:48"} ]

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.getRecordById() 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

  • To fetch the string value to which the specified key is mapped, use get()
  • To get values from fetched records, use getJSON()
  • To convert the json string to list format, use toJSONList().

Share this post : FacebookTwitter

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

Write to us: support@zohocreator.com