How to connect Power Automate with Cloud BOT

What is Power Automate

https://flow.microsoft.com/en-us/

Power Automate is a tool to automate your task by connecting one web service or application with another. This kind of integration services is known as iPaaS(integration Platform as a Service).

Power Automate is a service that focuses on Microsoft products and automates workflows between various applications. It is connectable to more than 400 (as of December 2020) web services and applications.

It is attracting attention from Japan because adding to Microsoft services such as Office365, Power Automate also supports a lot of cloud services for businesses such as Gmail, Slack, and Salesforce.

In Power Automate, Flow is an automated workflow that connects apps and services called connectors together, and it is consists of a trigger and an action. The action event will be performed when the trigger event is triggered.

Cloud BOT is provided as a Premium connector. Premium connectors can only be used through a paid subscription to Power Automate.

Connection setting in Cloud BOT

It is necessary to enable the external connection of Cloud BOT to connect with Power Automate.

Enable external connection

Login to Cloud BOT and choose Connect on the side menu.

Turn the switch ON of "External Connections".

You can find the BOT list is displayed if you turned on the external connections switch.

Choose your BOT to connect

Next, we are going to choose the BOT to connect.
Turn the switches on of the BOT that you want to connect with external services on the "BOT to connect".

Only the BOTs that have been turned ON will be available in Power Automate.

If you want to make all your new BOT enable to connect, you can turn on the "Automatically enable the connection with new created BOT."

Login to Power Automate

Go to Zapier website: (https://flow.microsoft.com) and login to it.

You need to login to Power Automate with your Microsoft account.

Create a Flow

Use Cloud BOT as a trigger

Create a new Flow that sets the BOT execution in Cloud BOT as a trigger, and add the BOT name and execution results to the Google sheet.

Trigger
Cloud BOT
When the BOT had been completed.

Action
Google Sheets
Add BOT name and execution results as a new row to Google sheet

Set Cloud BOT as a trigger

Click Create on the left navigation menu and select Automated cloud flow.

When a Build an automated cloud flow window shows, skip it.

Search for Cloud BOT and select it as a trigger.

Select When BOT execution is completed.

Click Sign in button and connect with Cloud BOT.

After login, you can find the authorization page. Read Terms and conditions and the Privacy Policy on the page and click Authorize.

Now Cloud BOT has been set as a trigger. Select your language, Contract, and your target BOT.

The connection is done.

Click New step and add your action.

Set Google Sheets as an action

Select your action connector. We are going to use google sheet as an action this time.

Input google sheets and search for it.

Click Google Sheets and select the Action. We are going to select the Insert row as an action this time.

After login and the authorization, Select your File and worksheet. Then set bot name as BOT, the status as status.

Connect your Connectors

Click Save and if the flow name had been changed, you have created your new flow successfully.

You can see your Flows in My flows page.

How to set parameters

You can set Output data 1~10 in Cloud BOT as Parameters Data1 to Data10.

※As it stands, Output data since Output data11 can not be directly passed, you need to use JSON format data in OutputJson for getting the above data.

In this case, if you set {{Data1}} in the action page, the "Index" in the Output data in Cloud bot will be passed as a parameter.

※If the output data was group data, all the values of lines will be combined as comma-separated data and passed as one parameter.

Use Cloud BOT as an action

Create a new flow that will execute the selected BOT when receiving an email.

Trigger
Gmail
Receive an Email.

Action
Cloud BOT
Run a Product Management BOT.

Set Gmail as a trigger

First, select your trigger connector. Input Gmail in the search form and find it.

Gmail is selected as a connector. Next, select When a new email arrives as your trigger.

Click Sign in to Gmail to authorize your Gmail account.

Click the Allow button after confirming the terms of service and privacy policies on the authorization page.

Select your Label.

You have set your trigger successfully.

Click New step and add your action.

Set Cloud BOT as an action

Search for Cloud BOT and select it as an action connector.

Now Cloud BOT has been set as an action connector. Next, Click Execute BOt as an action.

Select the Language, Contract, BOT, Async, and other Data if necessary, and click the Save button.

※If the Async function is enabled, you will get a response as soon as the BOT starts running. The response does not include the execution result value of the BOT.

Connect your Connectors

Click Save and if the flow name had been changed, you have created your new flow successfully.

You can see your created Flow in My flows page.

How to set parameters

You can set the data passed form trigger as a input data in Cloud BOT.

Parameters Data1~Data10 will be used as Input data 1~10.

Parameters Data1~Data10 will be used as Input data 1~10.

※As it stands, Data after Input data 11 can not be directly passed, you need to use JSON format data in API parameters for passing the above data.API parameters are the payloads for API Parameters in JSON format. If Data1~10 also have been set in the input form, those values will be overwritten.

※If the input data is group data, you can input those data for each line as comma-separated data.