Trigger a Flow to Covert a document to PDF in SharePoint using Button

In my previous blog post, we created a Flow which can be manually started on a document in a SharePoint Online document Library or List. In this blog, we will create a button using column formatting which will launch a Flow on that item.

Please make sure the following prerequisites are in place:


Step 1: Navigate to https://flow.microsoft.com and open the Flow that we created in our previous blog post.

Flow.jpg

Step 2:  Copy the ID from the end of the URL to the clipboard. For example https://emea.flow.microsoft.com/manage/environments/Default-444e7b96-eeb2-45d5-a9ff-4bef8830b240/flows/8537634d-2e56-4d98-a494-ed856b68a70a/details

Step 3: Navigate back to the SharePoint Online document library, click on the column (Button) drop down and click on “Format this Column“.

Format Column

Step 4: Use the GUID that we copied in Step 2 in the JSON below.

{
“$schema”: “https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json“,
“elmType”: “span”,
“style”: {
“color”: “#0078d7”
},
“children”: [
{
“elmType”: “span”,
“attributes”: {
“iconName”: “Flow”
}
},
{
“elmType”: “button”,
“style”: {
“border”: “none”,
“background-color”: “transparent”,
“color”: “#0078d7”,
“cursor”: “pointer”
},
“txtContent”: “Run Flow”,
“customRowAction”: {
“action”: “executeFlow”,
“actionParams”: “{\”id\”: \”8537634d-2e56-4d98-a494-ed856b68a70a\”}”
}
}
]
}

Step 5: Copy the JSON below in the Column Formatter and Click on Save, you should see the Button Hyperlink.

SharePoint Column Formatter.jpg

 

Thanks for reading 🙂.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s