- 概述
- Adobe Sign
- Alteryx
- Amazon Comprehend
- Amazon Connect
- Amazon Rekognition
- 亚马逊文本提取
- Box
- 认知
- DocuSign
- Google Vision
- Jira
- Marketo
- Microsoft Dynamics
- Microsoft Dynamics (Finance and Operations)
- Microsoft Teams
- Microsoft Translator
- Microsoft Vision
- Oracle 集成云
- Oracle NetSuite
- Salesforce
- SAP BAPI
- ServiceNow
- Slack
- Smartsheet
- SuccessFactors
- Tableau
- Twilio
- Workato
- Workday
快速入门
在 UiPath 自动化中快速入门使用 Salesforce 活动
概述
本指南旨在帮助您创建工作示例,以快速验证与 Salesforce 组织的连接,并熟悉所包含的活动输入/输出数据类型。
完成本指南中的步骤后,您将获得一个自动化序列,该连接器将执行以下操作:
- 为 Salesforce 凭据和调用方法创建
SecureString变量。 - 使用您的
SecureString凭据建立与您的 Salesforce 组织的连接( Salesforce 应用程序作用域) - 创建新的 Salesforce 帐户记录(插入记录)。
- 将文件上传到您的 Salesforce 组织(上传文件)。
- 将上传的文件分配给新的 Salesforce 帐户记录(分配文件)。
- 通过输出每个活动的 Salesforce 状态对象() ,验证 插入记录 、 上传文件 和 分配文件 活动的结果。
先决条件
在开始之前:
- 完成 Salesforce设置步骤。
- 创建一个新的自动化项目。
-
打开 UiPath Studio。
-
Under New Project, click Process (this opens a New Blank Process window).
-
Enter a project Name, Location, and Description.
-
单击“创建”。
-
- Install the UiPath.Salesforce.Activities package.
- In the Design ribbon, click Manage Packages (this opens the Manage Packages window).
- Under All Packages, click Official.
- In the Search bar, enter Salesforce.
- Click, install and accept the license for the UiPath.Salesforce.Activities.
-
有关 Uipath Studio 包的更多信息,请参阅 Studio 指南中的管理包。
-
步骤
构建项目
“Salesforce 应用程序作用域”活动的使用者密码、密码和安全令牌输入属性需要SecureString数据类型。要获取这些SecureString 数据类型,请在完成String 设置 指南中的 获取凭据 步骤时转换为这些属性存储的 值。
以下步骤旨在演示如何将String转换为SecureString 。为简单起见,并帮助您快速创建工作示例,转换在项目序列中完成,并要求您输入凭据值作为变量。在创建可共享项目或非示例项目时,不建议这样做。在创建可共享项目或非示例项目时,您可以创建和引用从本地来源(例如.txt 、.xlsx文件),并使用
将字符串转换为安全字符串
- 创建以下三个变量:
Stringwith your Salesforce login password as the Default value (e.g., Name: textPassword, Default: "UiPath123")SecureStringwith New SecureString() as the Default value (e.g., Name: securePassword, Default:New SecureString())SecureString(e.g., Name: password)- For all
SecureStringvariables, select the System.Security.SecurityString type.
- For all
- 向流程中添加新语句。
- Recommendation: change the Display Name to "Create SecureString - Password" or something to make it easy to identify its purpose.
- 在序列中添加活动。
- In the TypeArgument property, select System.Char.
- In the Values property, enter the
Stringvariable (e.g., textPassword).
- 在“遍历循环”活动中,添加“调用方法”活动(“编程”>“执行”>“调用方法”)。
- In the TargetObject property, enter your first
SecureStringvariable (e.g., securePassword)- Make sure the the TargetType property is (null) (either the TargetObject or TargetType is allowed, not both).
- In the MethodName property, enter AppendChar.
- AppendChar方法用于在字符串后添加 UTF-16 代码单元。
- In the Parameters property, add a new parameter using the following values: Direction: In, Type: System.Char, Value: item.
- In the TargetObject property, enter your first
- 将该活动添加到“调用方法”活动之后。
-
In the To property, enter your second
SecureStringvariable (e.g., password). -
In the Value property, enter your first
SecureStringvariable (e.g., _securePassword).
-
- 创建以下三个变量:
Stringwith your Consumer Secret as the Default value (e.g., Name: textPassword, Default: "4FA94...")SecureStringwith New SecureString() as the Default value (e.g., Name: secureConsumerSeret, Default:New SecureString())SecureString(e.g., Name: consumerSecret)- For all
SecureStringvariables, select the System.Security.SecurityString type.
- For all
- Repeat steps 2-5 to convert your Consumer Secret
Stringto aSecureString.
- 创建以下 3 个变量:
Stringwith your Security Token as the Default value (e.g., Name: textPassword, Default: ""MUc2B...")SecureStringwith New SecureString() as the Default value (e.g., Name: secureSecurityToken, Default:New SecureString())SecureString(e.g., Name: securityToken)- For all
SecureStringvariables, select the System.Security.SecurityString type.
- For all
- Repeat steps 2-5 to convert your Security Token
Stringto aSecureString.
You should now have three Create Secure String sequences in your process, similar to the image below.
Now that you have your SecureString variables, you can add the Salesforce Application Scope activity along with the other Salesforce activities.
添加 Salesforce 活动
- 将“Salesforce 应用程序作用域”活动添加到您的项目中。
-
在输入属性值之前,我们来测试您的连接。
- Click the Configure button (this opens the connection wizard).
- Select your Server (if connecting to, a developer org or non-developer production org- select "Live", a sandbox/test org - select "Test").
- Enter your Consumer Key, Consumer Secret, Username, Password, and Security Token (required for developer logins).
- Click the Test Connection button and wait for the Connection Successful window.
-
- 连接成功后,您现在可以添加属性值,包括在上述步骤中创建的
SecureString变量(在连接向导中输入的值独立于属性值,也不共享)。
-
输入您在完成 获取凭据 步骤时复制的 使用者密钥 值 ( )。
String -
In the ConsumerSecret property, enter the second
SecureStringvariable you created in step 6 above (e.g., consumerSecret). -
In the Password property, enter the second
SecureStringvariable you created in step 1 above (e.g., password). -
Enter your Server value ("Live" or "Test").
-
输入您的 Salesforce 登录用户名(例如
"name@company.com") -
For the SalesforceConnection property, create and enter a
IConnectionServicevariable (e.g., salesforceConnection).-
完成本指南中的步骤时,您不会使用此变量,但最好创建输出变量以在后续活动中使用。
-
-
Create a new
Stringvariable for this activity's output property (e.g., newAccountID). -
Click the Configure button (this opens the Salesforce Object Wizard).
- 要了解有关向导工作方式的更多信息,请参阅 关于 Salesforce 活动 页面中的“Salesforce 对象向导” 部分。
-
In the Salesforce Object drop-down list, select Account (the Account ID and Name fields should appear).
-
In the Add Single Field text box, enter Type and click Enter (you should now have 3 fields).
-
In the Account ID field, enter the
Stringvariable you created in step 1 (e.g., newAcountID). -
Enter a Name for the Account (e.g., "Salesforce Quickstart").
-
Enter a valid Type
String(e.g., "Prospect").-
All fields with a
picklistData Type require aStringvalue that matches an item in the list as shown in the Salesforce user interface.-
以“类型”字段为例,默认情况下,选取列表包含下图(来自“Salesforce 帐户”屏幕)所示的值。您可以使用“为标签和值设置格式”活动预览有效的
String值(请参见下面的示例)。
-
-
Click Done.
-
-
In the SalesforceOutput property, create and enter a
SalesforceStatusvariable (e.g., insertRecordStatus).
-
- 在“插入记录” 活动之后添加“上传文件” 活动。
-
Enter your file Description, FilePath, and Title.
-
In the OutputID property, create and enter a new
Stringvariable (e.g., newFileID). -
In the SalesforceStatus property, create and enter a new
SalesforceStatusvariable (e.g., uploadFileStatus).
-
- 在“获取记录” 活动之后添加“分配文件” 活动。
-
In the Id property, enter the
Stringvariable you created for the Upload File activity (e.g., newFileID). -
In the RecordId property, enter the
Stringvariable you created for the Insert Activity activity (e.g., newAccountID). -
Enter a ShareType value (e.g., "I" for Inferred).
-
Enter a Visibility value (e.g., "AllUsers").
-
In the SalesforceStatus property, create and enter a new
SalesforceStatusvariable (e.g., assignFileStatus).
-
测试您的项目
-
要验证您的记录是否已插入、文件已上传并分配给插入的记录,请在“分配文件”活动之后添加 3个活动。
-
In the first Write Line activity, enter the following Text: "Insert Record Success: "+insertRecordStatus.Success.ToString.
- insertRecordStatus is the
SalesforceStatusvariable you created for the Insert Record activity.
- insertRecordStatus is the
-
In the second Write Line activity, enter the following Text: "Upload File Success: "+uploadFileSuccess.Success.ToString.
- uploadFileStatus is the
SalesforceStatusvariable you created for the Upload File activity.
- uploadFileStatus is the
-
In the third Write Line activity, enter the following Text: "Upload File Success: "+assignFileSuccess.Success.ToString.
- assignFileStatus is the
SalesforceStatusvariable you created for the Assign File activity.
- assignFileStatus is the
-
Click Start and verify the results in the output window.
-
-
To further verify your results, login to your Salesforce Org and go to your Accounts and Files to see your new additions.
操作完毕!您现在拥有一个包含 Salesforce 活动的自动化项目。要了解有关 Salesforce 活动的更多信息,请参阅活动以获取指向活动详细信息页面的链接。
要进一步实现 Salesforce 自动化,请参阅UiPath Connector for Salesforce文档。UiPath 连接器 for Salesforce 在 Salesforce 和 UiPath Orchestrator(内部部署或云实例)之间创建“服务器 - 服务器”连接。您可以使用该工具通过流构建器、流程构建器或工作流提交 UiPath 作业或从 Salesforce 添加队列项目。