Choose where you’d like to start

Search records in Salesforce

Overview

Search records in Salesforce using a criteria. 

Note: This task is applicable only to Zoho Creator.

Syntax

<variable> = salesforce.sales.searchRecords(<salesforce_connection>, <criteria>);

where,

ParameterDescriptionData type

<variable> 

is the variable which will hold the response returned by Salesforce.

KEY-VALUE

<salesforce_connection> 

is the name of the Salesforce connection.

TEXT

<criteria>

is the criteria based on which records will be searched.

The criteria must be in the following format:

"SELECT <columns_seperated_by_comma> FROM <module> WHERE <field>=<'value'>"

The specified columns' values will be returned from the specified module from the records which meet the criteria.

TEXT

Search records by criteria in Salesforce

The following snippet when executed searches for the record which meets the criteria, and returns the values for the specified columns, from the "Account" module. 

response = salesforce.sales.searchRecords("Salesforce", "SELECT Name,id FROM Account WHERE Industry='Chemicals'");

where,

ParameterDescription
"Salesforce"is the name of the Salesforce Connection
Name
id
are the field names whose values will be returned.
"Acc​ount"is the module in Salesforce, where the records will be searched
Industry='Chemicals'is the criteria based on which the record will be fetched.

Sample Response

Following is a sample success response returned by Salesforce:

{  
   "done":true,
   "records":"[{"   Name":"John",
   "Id":"00190000010xPIuAAM",
   "attributes {"   type":"Account",
   "url":"/services/data/v20.0/sobjects/Account/00190000010xPIuAAM"
}
}
]

The following is a sample failure response:

{  
   "message":"\nSELECT * FROM Account where Name='John'\n ^\nERROR at Row:1:Column:7\nunexpected token: '*'",
   "errorCode":"MALFORMED_QUERY"
}

Related Links

Get Started Now

Execute