Add group data acquired by BOT to spreadsheet
Home > Connect > Power Automate > Add group data acquired by BOT to spreadsheet
Japanese may be displayed on some pages.
Creating a flow
Create a flow that sequentially executes the process of writing to a spreadsheet using the list data obtained in the cloud BOT.
Cloud BOT（When BOT execution is completed）
Get the BOT execution result when the BOT execution is completed.
Control（Apply to each）
The following actions are executed sequentially for the number of rows of group data acquired by the trigger.
Google Sheets（insert row）
Insert row data into the spreadsheet.
Setting Cloud BOT
1.Click "Create" from the navigation menu on the left side of the screen and select "Automated Cloudflow".
2. Although a modal window of "Build an automated cloud flow" will be displayed, press the "Skip" button."
3. Search for "Cloud BOT" and click the icon.
4. Select "When the BOT execution is completed" for the trigger.
5.Set the trigger. Click here for setting values.
*Create a connection if it doesn't exist. Click here for information on creating a connection.
In order to process the group data sequentially, it is necessary to create an array for the number of columns of the group data. Also, you need to create an INDEX variable to refer to the row during sequential execution. Reference the next row in the array by incrementing the INDEX variable at the end of the sequence.
Create a flow as follows.
- Create an array for the number of columns of group data
- Create an INDEX variable
- Set up sequential execution
- Increment the value of the INDEX variable
Create an array for the number of columns of group data
- Select "New Step".
2.Search for "variable", click the icon and select "Initialize Variable".
3. Specify "name" and "type".
In this example, "name" is "acquired group name", "type" is "array", and "value" is "output value obtained from trigger".
The output value Data1.product ID (text data of the group) obtained from the trigger is split with the delimiter (comma) using the split function to create a string array.
Click here for information about the text format of Cloud BOT.
4. Initialize variables for the number of columns of the target group data that you want to set to the action.
Create an INDEX variable
Create an INDEX variable (array subscript) to specify an element in the array. Add an "initialize variables" action.
In this example, specify "INDEX" for "name", "integer" for "type", and "0" for "value".
Set up sequential execution
- Select "New Step".
2. Press the built-in tab and search for "control". Click the "Apply to each" icon.
3. Specify the variable you formatted earlier to "Select an output from the previous step".
Increment the value of the INDEX variable
1.Select "Add Action". Set "Configure Google Sheets" first.
2. Search for "variables" and click the icon. Select "Increment value.
3. Specify the "name".
Setting Google Sheets
- Select "Add Action".
2. Search for "Google Sheets" and click the icon.
3.Select "Insert row".
4. Set the action. Set "File", "Worksheet" and specify "Current item" specified in "Apply to each".
*Create a connection if it doesn't exist.
In this example, variables and INDEX are specified in the variables function.
A flow has been created. Check the operation from "Test" in the upper menu (upper right of the screen). If you can confirm the execution result, the setting is completed.
If you actually check the spreadsheet, it will be written as follows.