Microsoft
Flow provides many features and integration options not available when using
basic Teamsware actions.
But you can
start a Microsoft Flow / Power Automate from Teamsware action quite easily
by using the Start Power Automate / Azure Function action:
Create a MS Flow with a Request
trigger and the steps you want
Configure the URL and JSON
payload in a Start Power Automate / Azure Function action type in teamsware
actions as:
Modern Forms (Command Bar
Actions, Form Load Actions)
List
Actions
Automation
Actions
Scheduled
Actions
Triggered
Actions
So let's
run through a simple example: We will create a new Google task when clicking
action links on the display form of a SharePoint item.
Create a
Microsoft Flow
and sign in (or register if
you haven't yet). Next select the "My Flows" and click on the
"New Flow -> Automated cloud flow" button:
On the
trigger selection dialog click "Skip" as the trigger needed is a
premium trigger which is not available here.
On the edit
screen of the new flow search for "http request" and select the
"When an HTTP request is received" trigger:
This will
be our incoming API to call Microsoft Flow using an HTTP Post request.
In the
option 'Who can trigger the flow?' select Anyone option
Note: Currently only 'Anyone' option (anonymous access) is supported
We need to
define the JSON schema to use for passing our parameters from the teamsware
action to Flow. Easiest is to use the "Use sample payload to generate
schema" and set some example JSON. In our case we need this:
{
"Title": "Our title",
"ItemUrl": "https://someItemsUrl",
"AssignedTo": "some email"
}
Microsoft
Flow will generate the JSON Schema for you then.
Next define
the steps that should be executed once this Flow is called. For the sake of
simplicity, let's just create a Google Task.
Add a new
action using New Step / Add an action:
Search for
"Google Task" and select the "Google Tasks - Create a task in a
task list" action:
Connect
using an existing Google account and configure the Task List ID, Title and
Notes optionally using dynamic content:
As you can
see above we can reuse parameters passed from our teamsware Actions.
Now save
your new Flow by giving it a name and pressing "Create flow":
Before
moving on to teamsware Editor copy the URL generated by Flow in the Request
trigger:
Now let's
open a display form of a task list in Teamsware studio and configure an
Action to start this MS Flow.
Add a new
Command Bar Action, set a good title (i.e. "Create Google Task") and
open the Action Builder using the actions symbol:
In the
action builder add a new action "Start Power Automate / Azure
Function" and set the following:
Paste URL we got from MS Flow
to the URL parameter
Data should be a valid JSON or
Custom Expression containing the values we need to pass:
{
"Title":
[[Title]],
"ItemUrl":
[[@Web.Url]]+"/Lists/FlowTest/DispForm.aspx?ID=[[ID]]",
"AssignedTo":
[[AssignedTo]]
}
When all
configured it should look like this:
Now save
the form and try it out in runtime on the display form.
Result
When the
link is selected on the display form a new Google Task is created with the
title containing the SharePoint tasks title and the user's name for the
assigned user.
Summary
With this
approach we can kickoff any actions possible with Microsoft Flow from Teamsware
actions too and provide advanced scenarios in our solutions for integrating
with other systems.