Skip to main content

Using Microsoft Power Automate for workflow automation

Integrating Blink with MS Power Automate.

Margaret Greer avatar
Written by Margaret Greer
Updated over a week ago

Microsoft Power Automate is a tool that allows users to create automated workflows between various apps and services. It allows you to extend Blink into your wider tech stack and connect it with your business processes.

Flow triggers

  • ⏰ At a scheduled time

  • 💪 Manually by the user

  • 🤖 Automatically, based on third party app event:

    • MS Form response submitted

    • New item added on SharePoint

    • Message posted to Teams channel

    • New email arrives

Example Use Cases

  • Send SharePoint news posts to Blink news feed

  • Manage holiday request approvals

  • Create automated onboarding journeys

  • Send notifications about due certifications

  • Send survey result dashboard to managers

Pricing

  • ⚠️ You need a premium license to add custom connectors

Volume limitations

  • Not meant for very complex (nested, multi-step)

  • Not meant for high volume flows (over 40,000 actions per day)

Error handling

  • Once limits are exceeded, the flows are paused

  • Debugging and troubleshooting can’t be done on Blink side


A guide on setting up SharePoint update flow

Example use cases

  • When a new page is created on a SharePoint site

  • When a task is created on MS Project

  • Policy document updates

Setting up the connector

Open Microsoft PowerAutomate and go to “Custom Connectors” and click “New custom connector”. Select “Import an OpenAPI file” option and upload the file provided by Blink.

Blink.swagger.json

{

"swagger": "2.0",

"info": {

"title": "My Blink connector",

"description": "",

"version": "1.0"

},

"host": "api.joinblink.com",

"basePath": "/",

"schemes": [

"https"

],

"consumes": [],

"produces": [],

"paths": {

"/v2/feed/events": {

"post": {

"responses": {

"default": {

"description": "default",

"schema": {}

}

},

"summary": "Create feed post",

"parameters": [

{

"name": "body",

"in": "body",

"required": false,

"schema": {

"type": "object",

"properties": {

"comments_enabled": {

"type": "boolean",

"description": "",

"title": "Enable comments",

"enum": [

"",

true,

false

],

"default": false

},

"reactions_enabled": {

"type": "boolean",

"description": "",

"title": "Reactions enabled",

"enum": [

"",

true,

false

],

"default": false

},

"external_id": {

"type": "string",

"description": "",

"title": "External identifier"

},

"category": {

"type": "string",

"description": "Defined in the app configuration on Blink",

"title": "Post category ID"

},

"user_ids": {

"type": "array",

"items": {

"type": "string",

"title": "Recipient User UUIDs"

},

"description": "user_ids"

},

"group_ids": {

"type": "array",

"items": {

"type": "string",

"title": "Recipient group UUIDs"

},

"description": "Group IDs"

},

"body": {

"type": "object",

"properties": {

"ribbon_colour": {

"type": "string",

"title": "Ribbon colour",

"description": "Colour of the border of the feed post."

},

"sections": {

"title": "Card section",

"type": "array",

"items": {

"type": "object",

"properties": {}

}

}

}

}

}

}

}

],

"operationId": "Blink-Feed-Post-Create",

"description": "Creates a feed post on Blink"

}

}

},

"definitions": {},

"parameters": {},

"responses": {},

"securityDefinitions": {

"API Key": {

"type": "apiKey",

"in": "header",

"name": "Authorization"

}

},

"security": [

{

"API Key": []

}

],

"tags": []

}

Configuring the flow: SharePoint news → Blink

This is an example of how you can build a flow that creates a feed post every time there's a news post created on SharePoint.

First, you need to create an automated cloud flow and select SharePoint “When an item is created” as the flow trigger.

Retrieving SharePoint page body

This trigger will initiate the flow whenever a new post is created on a specified SharePoint site, however the trigger alone does not retrieve all the required information for our Blink post.

To get that information, we need to call SharePoint API by using “Send an HTTP request to SharePoint” action.

This needs to be configured to retrieve the content of the new SharePoint post.

Use the following string in the Uri parameter:

_api/web/lists/getbytitle('Site Pages')/items(@{triggerOutputs()?['body/ID']})/FieldValuesAsHtml?$select=CanvasContent1

Once that’s done, you will need to parse the response received from SharePoint API, using “Parse JSON” action. The below image shows how this action should be configured.

  • Schema value

    { "type": "object", "properties": { "CanvasContent1": { "type": "string" } } }

Creating Blink post

To create a Blink post, use the custom connector configured earlier. Specify the recipient groups or users by adding their UUIDs as custom values.

💡 Lookup is not supported yet. This can be implemented once Blink SCIM and Feed API can be accessed using the same API token

In the card section, add the JSON definition of each segment of your feed post, starting with the title.

In order to display nicely on Blink, the canvas content from SharePoint API will need to be parsed to a markdown compatible format.

This can be done using the following expression:

join(xpath(xml(body('Parse_JSON')?['CanvasContent1']),'//p|//ul'),'')

This converts the HTML canvas body returned by SharePoint API into XML format, then using XPath expressions, extracts all paragraphs and unordered lists (you can add additional node types in the expression - just make sure they can be rendered in Markdown). The resulting array is then joined into a string, which is passed as the value of the text section in Blink post.

This results in the following post:

This, however, is still missing images. Posting raw <img> tags will not work, because images must be added as a separate section. This can be done by incorporating a few additional actions to the flow.

Adding images

Since SharePoint canvas may contain multiple images (like in the example shown above), we will need to extract them and add them in a gallery section on Blink post.

This can be done by initialising two variables using the “Initialize variable” action. The first variable ImageSources will contain the source URLs of the images extracted from SharePoint page canvas.

The ImageGallery variable will contain the JSON array that will be added directly into the Blink post. The expression used to declare the value of ImageSources variable is as follows:

xpath(xml(body('Parse_JSON')?['CanvasContent1']),'//img/@src')

Once ImageSources variable captures the array of image source URLs, it needs to be added to ImageGallery variable using “Append to array variable” action within “Apply to each” loop.

The expression used in this action is as follows:

setProperty(json('{"type": "gallery_image"}'), 'image_url', slice(item(),5,-1))

This creates an array that looks like this:

[{
"type": "gallery_image",
"image_url": "https://cdn.hubblecontent.osi.office.net/m365content/publish/bc330ac9-e8f7-4c24-bdd1-6d792a4ce9d0/image.jpg"
},{
"type": "gallery_image",
"image_url": "https://cdn.hubblecontent.osi.office.net/m365content/publish/00143758-532c-4a86-892c-ba7401b6459e/1267433806.jpg"
}]

The last step is to add another section into Blink feed post action and pass the newly created ImageGallery variable:

The resulting post will now pick any images that are added to the body of the SharePoint post and attach them as an image gallery to Blink feed post:

The full flow looks like this:

And you're done! For any support, please contact the support team.

Other Resources

  • Power Automate Template (download from the bottom of this article)

Did this answer your question?