activities
latest
false
UiPath logo, featuring letters U and I in white
Classic Integrations Activities
Last updated Nov 8, 2024

About the Salesforce activity package

The UiPath.Salesforce.Activities pack enables you to automate Salesforce processes. It can connect to a Salesforce Org via the Salesforce Application Scope and, alongside the rest of the activities, enable you to perform actions such as file manipulation, record manipulation, report execution, and SOQL commands execution.

Once established, the connection to the Salesforce Org can be stored into a IConnectionService object and easily reused in all subsequent child Scope activities. The credentials for the connection are encrypted by use of the Microsoft .NET Data Protection API (DPAPI) and can only be accessed by the same user and on the same machine they were entered on.

Prerequisites

A Salesforce account as well as a Salesforce Connected App are both required to use the Salesforce activities. These can be acquired from your Salesforce Administrator.

Alternatively, RPA Developers can use a Salesforce Developer account for automating processes in Salesforce.

The SalesforceStatus Object

All of the activities that perform data manipulation in Salesforce return a proprietary datatype, called SalesforceStatus. This object contains details on the status of each activity's execution in interaction with Salesforce. The object is structured to contain the following properties:
  • Success - States whether the action was successful or an error was thrown.
  • ErrorCode - In case an error is thrown upon execution, returns the error code from Salesforce.
  • Message - In case an error is thrown upon execution, returns the error message from Salesforce.

The Salesforce Object Wizard

The Get Record, Insert Record, and Update Record activities can be configured by using the Salesforce Object wizard. Clicking the Configure button present in the body of the activities opens this window.



The Salesforce Object drop-down lets you select the object you want to interact with, displaying all its details. The first record in that object is also retrieved as a Sample Record. The Sample Value column shows the value of the field for that record.



Note: When a Salesforce Object is selected, the list of fields is populated with the list of fields that are marked as mandatory across all the layouts of the object in Salesforce. Due to the limitation of the available configuration details from Salesforce, there could be more fields that are mandatory, but are not added by default. Use the Test with sample values to test the activity.

By using the Add Single Field text box, you can add fields to the selected object. The Add Multiple Fields button opens a different section of the wizard, which lets you choose multiple fields to add to the object. This can be done by selecting the check marks for all of the fields you want to add and clicking Done.



Note: In the Insert Record activity, only the fields that are identified as being allowed to be created by the Salesforce Lightning API are available. In the Update Record activity, only the fields that are identified as being allowed to be updated are available.

Clicking Done again saves the changes you made to the activity that was being configured.

The Insert Record and Update Record activities also have the option of testing the operation with sample values. This can be done by clicking the Test with sample values button. This executes the operations with the values in the Sample Value column, and reports success or errors.



Salesforce Object Fields and Data Type

In the Get Record, Insert Record, and Update Record activities, all field values are passed as String.
For fields with the Picklist data type, the string passed should be the valid value and not the label as seen in the application. Use the Format Labels And Values activity to setup the string correctly.
For fields with the Multiplicklist data type, the string passed should be a list of the valid values separated by semicolons and not the labels as seen in the application. Use the Format Labels And Values activity to setup the string correctly.
For fields with the Boolean data type, the string passed should be true or false. Note that when Salesforce returns these values in the Get Record activity, the values shown in the Sample Value column can be either of the following: True, true, False, or false, depending on how data was originally entered in Salesforce.
For fields with the Date data type, the string passed should be in the format YYYY-MM-DD.

Salesforce Extension Functions

We have implemented two new functions that are shipped with the Salesforce activities pack, which help you to better automate processes in Salesforce:

Format As Boolean

UiPath.Salesforce.Utilities.UtilityFunctionExtension

String SalesforceFormatAsBoolean(String Value)

Inputting a Boolean type value that is not in the format supported by Salesforce throws an error at runtime. The SalesforceFormatAsBoolean function allows you to convert any type of Boolean value in a string to the format supported by Salesforce.

Supported Values

For True, the following values are convertible: 1, x, t, true, yes, y.
For False, the following values are convertible: 0, null, f, false, no, n.
Note: All of the values mentioned above are case-insensitive (which means that they are identified whether they are capitalized or not) and are recognized from any available alphabet.
Escape Search Term

UiPath.Salesforce.Utilities.UtilityFunctionExtension

String SalesforceEscapeSearchTerm(String SearchTerm, Boolean IsLike = true)

This function escapes search terms that can be used in the SOQLCommand property in the Execute SOQL activity, as required by Salesforce. For more information on Quoted String Escape, you can go here.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.