Get Records by Id from Zoho CRM
Table of Contentsup
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.
<response> =zoho.crm.getRecordById(<module_name>, <record_ID>);
is the response returned as MAP by Zoho CRM.
is the name of the CRM module, of STRING datatype, from where the records will be fetched. Following is the list of supported modules.
is the id the record, of Number datatype, that needs to be fetched.
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" ) ;
The response returned is of the following format:
By":"test","No of Employees":"0","MODIFIEDBY":"231356000000034003","Annual Revenue":"0","Email":
"firstname.lastname@example.org","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"} ]
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.
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.