Execute SOQL
UiPath.Salesforce.Activities.ExecuteSoql
Executes a Salesforce Object Query Language (SOQL) command in Salesforce and returns the query results in a DataTable. This activity only functions inside a Salesforce Application Scope activity.
Properties
Common
- DisplayName - The display name of the activity.
Input
-
SOQLCommand - The SOQL command that you want to run. This must be a valid SOQL command. This field supports only strings and
Stringvariables.noteSOQL defines several escape sequences that are valid in queries so that you can include special characters in your search text. You can escape new lines, carriage returns, tabs, quotes, and more. The escape character used in SOQL is the backslash (
\) character. You can find out more information by checking the official Salesforce documentation, which can be found here.If every search string that is concatenated into the SOQL Command is not escaped, the activity throws a
MALFORMED_QUERYerror when these special characters are present in the search string. Each search string should be escaped as follows before concatenating:str_Company.Replace(“\”, “\”).Replace(“'“, “\'”).Replace(“”””, “\”””)e.g. If the SOQL command is
"Select Id from Account where Name = '" + str_Company + "'"and
str_Company is John's Pizzais passed without being escaped, aMALFORMED_QUERYerror is returned. The correct SOQL command is:"Select Id from Account where Name = '" + str_Company.Replace(“\”, “\”).Replace(“'“, “\'”).Replace(“”””, “\”””) + "'"
Misc
- Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
Output
- Result - The result of running the SOQL command in Salesforce, stored in a
DataTablevariable. This field supports onlyDataTablevariables. - SalesforceStatus - The status that is returned from Salesforce once the action is completed, stored in a
SalesforceStatusvariable. This field supports onlySalesforceStatusvariables.