activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

生产力活动

上次更新日期 2025年9月16日

将新客户添加到 SharePoint 列表

关于

摘要:将新客户添加到 SharePoint 列表,并使用其数据创建 Salesforce 帐户。

应用程序:SharePoint 列表、Excel、Salesforce

说明:此示例说明如何将新 Excel 文件中的所有新客户添加到 SharePoint 列表,然后在 Salesforce 中为每个新客户创建一个新客户和联系人。接下来,使用 Salesforce ID 和状态“已处理”更新 SharePoint 列表项目。最后,为已处理的文件创建一个新文件夹并移动 Excel 文件。

This example presents Microsoft 365 activities such as File Created, Add List Item, Get List Items, as well as Salesforce activities such as Create Account and Create Contact.

备注:
SharePoint 列表活动使用列名称,但 Studio 用户界面会公开列的显示名称。 例如,如果您有一个名为 Salesforce ID的列,当您在变量中检索此字段时,变量将为 [...]field_5 ,因为 field_5 是后端中的列名称。

工作流

  1. 打开 Studio Web 并创建一个新项目。
  2. For How to start the automation select Event based, then select the Microsoft 365 File Created trigger activity.
  3. 在触发器活动中:
    1. 设置 Microsoft OneDrive 和 SharePoint 连接。
    2. 设置“ 位置 ” 字段。 例如,选择一个 OneDrive 文件夹。


  4. Add a For Each Row in Workbook activity:
    1. 在“工作簿” 字段中,选择“已 创建触发器文件” 活动的输出变量。
    2. 选择“范围”。 例如,工作簿中的第一张工作表Sheet1
    3. 根据需要配置其他字段。 例如:
      1. “有标头” - 设置为 “True”
      2. 如果行为空 - 设置为“跳过”。


  5. Inside the For Each Row activity, add a SharePoint Add List Item activity, to create new customers.
    1. 选择所需的 SharePoint 列表


  6. 接下来,仍在“遍历循环”中添加一个活动。 将其重命名为 “写入单元格 - 状态” ,以便稍后轻松识别并进行配置:
    1. 在“工作簿”字段中,选择“已 创建文件”触发器活动的输出变量。
    2. 选择“工作表/命名范围”。
    3. In the Cell field, select the CurrentRow variable of the For Each Row in Workbook activity and drill down to the Status_Address property.
    4. “写入内容” - 在字段中键入“已 添加”。


  7. Add a second Write Cell activity. Rename it to Write Cell - SharePoint List ID and configure it:
    1. 在“工作簿”字段中,选择“已 创建文件”触发器活动的输出变量。
    2. 选择“工作表/命名范围”。
    3. In the Cell field, select the CurrentRow variable of the For Each Row in Workbook activity and drill down to the SP_List_ID_Address property.
    4. For What to write - Select the output variable of the Add List Item activity and drill down to the ID property.


  8. Next, outside the For Each Row activity, add a Get List Items activity. This retrieves the customer information.
    1. 选择 SharePoint 列表。
    2. 在“要检索的列” 字段中,选择所需的所有客户字段。 例如:名字、姓氏、电子邮件、电话、Salesforce ID、ID 和职位。
      注意: 这些是列的显示名称。 后端中的列标题会有所不同。




  9. 添加 “遍历循环” 活动:
    1. 对于“项目列表” 字段,选择上一个 “获取列表项目” 活动的输出变量,然后向下钻取到 Rows 属性。
    2. 项目 字段将自动设置为 currentDataRow


  10. 在“遍历循环”中添加一个“ IF 条件”活动。 这确定了在 Salesforce ID 字段为空的情况下要执行的操作。
    1. 设置 条件:if currentDataRow.field_5要检索的列中的 Salesforce ID) 为空文本。 在表达式编辑器中,条件为: string.IsNullOrEmpty(currentDataRow.field_5) = true
      注意: Salesforce ID 是显示名称, field_5 是后端列名称。


  11. 设置“ Then ”分支,即在条件为 True 时要执行的活动。
    1. 添加“日志消息” 活动,以记录列表项目标题。 在 消息 字段中,选择“遍历循环currentDataRow 变量并向下钻取到 Title 属性。 这对应于客户名称(SharePoint 列表中的“标题” 列)。
  12. 添加“Salesforce 创建帐户”活动。
    1. 对于“帐户名称”,选择 currentDataRow.Title 变量。
  13. 添加 Salesforce 创建联系人 并进行配置。 将活动字段与使用“获取列表项目” 活动中的“ 要检索的列” 字段检索到的信息进行匹配:
    1. 姓氏 - 设置为 currentDataRow.Lastname 变量。 显示为 currentDataRow.field_2
    2. 帐户 - 选择“创建帐户”活动的输出变量。
    3. 电子邮件 - 设置为 currentDataRow.Email 变量。 显示为 currentDataRow.field_3
    4. 名字 - 设置为 currentDataRow.Firstname 变量。 显示为 currentDataRow.field_1
    5. 电话 - 设置为 currentDataRow.Phone 变量。 显示为 currentDataRow.field_4 变量。


  14. Next, add an Update Single List Item activity and configure it:
    1. 选择 SharePoint 列表
    2. 对于“列表项目 ID”,选择“遍历循环” currentDataRow.ID 变量。


  15. 不要配置 Else 分支。
  16. Next, add a Get File/Folder activity:
    1. 文件或文件夹 URL - 选择“已 创建文件”触发器活动的输出变量,然后向下钻取到其 ParentUri 属性。


  17. Add a Create Folder activity and configure it:
    1. 文件夹名称 - 例如,将名称设置为“ Processed Files”
    2. Parent folder - Select the output variable of the Get File/Folder activity.
    3. 如果文件夹已存在 - 设置为 “自动重命名”


  18. Add a Move File/Folder activity, to move the new file to the processed items folder.
    1. 要移动的文件或文件夹” - 选择“已 创建文件”触发器活动的输出变量。
    2. “目标文件夹” - 选择“创建文件夹”活动的输出变量。
    3. 如果文件/文件夹已存在 - 设置为 Replace


  19. 您已完成操作,可以运行项目了!
  • 关于
  • 工作流

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo
信任与安全
© 2005-2025 UiPath。保留所有权利。