Google Sheets VBO

Google Sheets VBO 允许 Blue Prism 在 Google Sheet 中创建和更新电子表格。它允许 Blue Prism 与单个单元格或单元格范围进行交互,以获取和设置这些单元格中的值和公式。

该 VBO 包含以下操作:

  • 附加数据—将给定的数据添加到指定的单元格或单元格范围中。
  • 清除范围—清除指定的单元格或单元格范围中的所有数据。
  • 获取范围值—从单个单元格或单元格范围中获取值或公式。
  • 设置范围值—为单个单元格或单元格范围设置值或公式。
  • 创建工作簿—在 Google Sheets 中创建新文档并返回其工作表 ID。

本文指导用户完成该 VBO 的安装和设置,并提供一些与其用法相关的指导。

先决条件

要配置并使用 Google Sheets VBO,需要有启用了 Google Sheets API 的 Google 帐户。还需要使用关联的 Google 客户端 ID 和密钥来配置必要的环境变量,以便访问该帐户的 Google 工作表。

要启用 API 和访问 Google 帐户的客户端 ID 及密钥,请转至 https://developers.google.com/sheets/api/quickstart/go

安装和设置

在将使用该 VBO 的每台设备(即运行时资源和相关的开发人员计算机)上:

运行 Blue Prism安装程序,然后在“自定义安装”页面上选择“Google Sheets Automation”

在您环境中的单个设备上:

  1. 导入该 VBO,使其在对象存储中可用
  2. 在 Blue Prism 中创建两个环境变量:
  • 名称

    Google Sheets API Client ID

    您的客户端 ID

    Google Sheets API Client Secret

    您的客户端密钥

    变量名必须与上述文本完全匹配,并区分大小写。

使用该 VBO

该 VBO 包含以下操作,当在操作环节中选择该 VBO 作为业务对象时即可使用这些操作:

  • 获取范围—从 Google Sheets 文档中的范围获取值集合。
  • 设置范围值—在 Google Sheets 文档中设置值范围。
  • 附加数据—将给定数据附加到工作表中的表。通过编程方式根据给定范围发现表,并且在表的末尾添加数据。
  • 清除范围—清除给定范围中的所有值。
  • 创建工作簿—创建新的 Google Sheets 文档并返回其 Google 工作表 ID。

要与现有电子表格进行交互,需要将 Google 工作表 ID 编号作为操作中的输入参数,以连接到正确的工作表。在互联网浏览器的地址栏中可以找到工作表 ID:

有关该 VBO 的更多信息,请参阅可从 Blue Prism 控制台访问的 API 文档:

帮助 > API 文档

 

Google Sheets VBO

The Google Sheets VBO enables Blue Prism to create and update spreadsheets in Google Sheets. It allows Blue Prism to interact with a single cell or range of cells to get and set values and formulas in those cell(s).

The following actions are included in the VBO:

  • Append Data - Adds the given data to a specified cell or range of cells.
  • Clear Range - Clears all data from the a specified cell or range of cells.
  • Get Range Values - Retrieves values or formulas from a single cell or range of cells.
  • Set Range Values - Sets the values or formulas for a single cell or range of cells.
  • Create Workbook - Creates a new document in Google Sheets and returns its Sheet ID.

This document guides a user through the process of installing and setting up the VBO and provides some guidance on its use.

Prerequisites

To configure and use the Google Sheets VBO, a Google account is required with the Google Sheets API enabled. The associated Google client ID and secret are required to configure the environment variables needed to access Google sheets for that account.

To enable the API and for access to the client ID and secret for a Google account client ID and secret, go to: https://developers.google.com/sheets/api/quickstart/go

Installation and setup

On each device that the VBO will be used, i.e. Runtime Resources and relevant developer machines:

Run the Blue Prism installer and select Google Sheets Automation from the Custom Install page.

On a single device in your environment:

  1. Import the VBO so it is available in the Object store
  2. Create two Environment Variables in Blue Prism:
  • Name

    Value

    Google Sheets API Client ID

    Your client ID

    Google Sheets API Client Secret

    Your client secret

    The variable names must exactly match the text above and are case sensitive.

Using the VBO

The VBO includes the following actions, available when it is selected as a Business Object in an action stage:

  • Get Ranges - Gets a collection of values from a range in a Google Sheets document.
  • Set Range Values - Sets a range of values in a Google Sheets document.
  • Append Data - Appends the given data to a table found in a sheet. Tables are discovered programatically based on the given range and the data is added at the end of the table.
  • Clear Range - Clears all values in the given range.
  • Create Workbook - Creates a new Google Sheets document and returns its Google Sheet ID.

To interact with existing spreadsheets, the Google Sheet ID number is required as an input parameter in actions to connect to the correct sheet. The Sheet ID is found in the address bar of the internet browser:

More information about the VBO can be found in the API documentation, accessed from the Blue Prism console:

Help > API Documentation.