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

生产力活动

上次更新日期 2026年3月6日

快速入门 - 查找、创建和添加

本指南旨在帮助您创建使用不同 Microsoft 365 活动的工作示例,这些活动包括 “查找文件和文件夹”“创建 工作簿”“添加工作表”“获取工作表”活动。

先决条件

在开始之前:

  1. 完成 Microsoft 365 设置步骤。
  2. 在 OneDrive 中创建或使用现有文件夹。 您将使用此文件夹来存储在以下步骤中创建的工作簿。
    • 您可以手动创建新文件夹,也可以按照创建、写入、读取快速入门指南创建。

步骤

构建项目
  1. “Microsoft Office 365 作用域”活动添加到您的项目。
  2. 输入已注册应用程序的应用程序 ID(有关更多信息,请参阅指南)。
  3. From the AuthenticationType drop-down list, select the applicable type (e.g., InteractiveToken).
    • If you select InteractiveToken and run the sequence while you're present, you don't need to add a Password, Tenant, or Username in the Unattended section (leave empty).
  4. From the Services drop-down list, select, at a minimum,Files.
  5. 在“Microsoft Office 365 作用域”活动之后添加“ 查找文件和文件夹” 活动。
  6. Enter a Query (e.g., the folder name) to find the folder that you created, or are using, from step 2 in the prerequisites above (e.g., "Quickstarts").
  7. Create and enter a DriveItem variable for your First value (e.g., firstResult).
    • When creating your variable, select Microsoft.Graph.DriveItem as the variable type.
    • When your Query is specific, with no chance of finding more than one result, you can use the First output property only. When your Query is less specific you can add a DriveItem[] variable for your Results value to return all folders that meet the query parameters.
  8. “创建 workbook”活动添加到“查找文件和文件夹”活动之后。
  9. Create and enter a String variable for your Name value (e.g., workbookName).
  10. In the Parent property, enter the DriveItem variable you created for the Find Files and Folders activity (e.g. firstResult)
  11. Create and enter a DriveItem variable for your Workbook value (e.g., newWorkbook).
  12. 在“创建工作簿” 活动之后添加“ 添加工作表” 活动。
  13. Create and enter a String variable for your Sheet value (e.g. sheetName_).
  14. In the Workbook property, enter the DriveItem variable you created for the Create Workbook activity (e.g. newWorkbook).
  15. 要指示机器人何时完成第一组活动,请在“添加工作表” 活动之后添加“消息框” 活动。
  16. Enter a String message (e.g., "Created "+workbookName+" and added "+sheetName).
测试您的项目
  1. 测试新工作表是否添加到创建的 workbook 中,在“添加工作表” 活动后添加“获取工作表” 活动。
  2. In the Workbook property, enter the DriveItem variable you created for the Create Workbook activity (e.g. newWorkbook).
  3. Create and enter a String[] variable for your Sheets value (e.g., workbookSheets).
  4. 在“获取工作表” 活动之后添加“写入行” 活动,验证是否已找到工作表。
  5. In Text property, enter a message that includes the String[] variable you created for the Sheets property (e.g., "Verified "+workbookSheets(1)+" was added!").
    • Because the variable is an array, you must specify the item you want to output by appending an integer value at the end (e.g., (1)).
    • In this example, you want to return the 2nd sheet from the workbook because the Add Sheet activity adds the new sheet at the end of existing sheets - when the new workbook the first sheet (i.e., "Sheet 1") was added by default.
  6. Click Run and verify that the Write Line activity includes the correct values to the Output panel (e.g., AddSheetExample).

准备就绪后,请尝试使用其他快速入门指南,以更熟悉不同的 Microsoft 365 活动。

工作方式

完成本指南中的步骤后,您将获得一个自动化序列,该连接器将执行以下操作:

  1. 与已注册的 Microsoft 365 应用程序( Microsoft Office 365 作用域)连接。
  2. 查找 OneDrive 中的现有文件夹以存储新工作簿(查找文件和文件夹)。
  3. 在找到的 OneDrive 文件夹中创建新的 workbook( “创建 workbook” )。
  4. 将新工作表添加到新创建的工作簿( “添加工作表”)。
  5. 通知您何时创建 workbook 和工作表( “消息框”)活动。
  6. 测试是否已添加新工作表( “获取工作表”“写入行” )。

docs image

  • 先决条件
  • 步骤
  • 工作方式

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新