Choose where you’d like to start

Fetch Record from Zoho CRM using record ID

Description

Fetch a record from Zoho CRM module using the record ID.

Syntax

<variable> = zoho.crm.getRecordById(<module_name>, <record_ID>, <query_value>, <connection>);

where,

ParamsData typeDescription

<variable>

KEY-VALUE

specifies the response returned by Zoho CRM. It represents the values fetched from the specified record against the API names of the respective fields.

<module_name>

TEXT

specifies the API name of the Zoho CRM module from where the record needs to be fetched. 

<record_Id>

NUMBER

specifies the ID of the record that needs to be fetched.

Learn how to fetch the ID of a record after creating , searching or fetching it.

<query_value>

(optional)

KEY-VALUE

holds all the other parameters specified in the Zoho CRM API.

Note:
  • The keys and values of this param should be provided according to the Zoho CRM API.
  • To ignore querying using this param, provide an empty map.
    For example: { "" : "" }

<connection>

(optional)

TEXT

is the name of the connection.

Note:

  • This param is not employed in Zoho Creator and mandatory in Zoho Cliq.
  • The <query_value> params must be specified to be able to specify this param.

Example

The following script fetches the record with ID - 23033XXXXXXXXXXXXXX in the Zoho CRM module - Leads.

response = zoho.crm.getRecordById("Leads", 23033XXXXXXXXXXXXXX); 

where,

response
is the KEY-VALUE response returned by Zoho CRM. It represents the values fetched from the specified record against the API names of the respective Zoho CRM fields.
"Leads"
is the TEXT that represents the API name of the Zoho CRM module from which the record needs to be fetched.

Response Format

Success Response

  • The success response returned is of the following format:
    {  
       "Owner":{  
          "name":"Ben",
          "id":"23033XXXXXXXXXXXXXX"
       },
       "Company":"Zylker",
       "Email":"bruce.wills@zylker.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":"23033XXXXXXXXXXXXXX"
       },
       "Skype_ID":null,
       "$converted":false,
       "$process_flow":false,
       "Phone":"+1 678 XXX XXXX",
       "Street":null,
       "Zip_Code":null,
       "id":"23033XXXXXXXXXXXXXX",
       "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":"23033XXXXXXXXXXXXXX"
       },
       "Fax":null,
       "Annual_Revenue":0,
       "Secondary_Email":null
    }

Failure Response

  • The failure response for incorrect or non-existent record ID will be returned in the following format:
     {
     "status": "failure"
     }
  • The failure response for incorrect or non-existent module name will be returned in the following format:
     {
     "code": "INVALID_MODULE",
     "details": {

     },
     "message": "the module name given seems to be invalid",
     "status": "error"
    }

Related Links

Get Started Now

Execute