Posts

Showing posts with the label Expressions

Detect When A Particular File-Type Is Uploaded To SharePoint Document Library

Image
You have a SharePoint Document Library where your users are uploading documents. You then use that information to perform other automated tasks such as closing tasks, getting approvals, sending notifications etc.  However you don't want your users to upload a particular file-type, for example, you don't want people to upload Excel Macros into the SharePoint Document Library. Every time someone uploads an Excel Macro file, you want to email them about your policy. To construct this in Power Automate, we will use endsWith() expression. We will create a Condition block and check if       endsWith(triggerOutputs()?['headers/x-ms-file-id'],'.xlsm') is true Under the "Yes" branch of this Flow, we can email the person who has uploaded the Excel Macro file about the policy, or take any other step as per our business use-case.

Get Link To A Particular Flow Run

Image
There can be various situations where you need to know the link to a particular Flow run, for example in case of a failure, or if you want to store the unique ID of each run against your data record for future audits or traceability. In this post, we will learn: How to get ID of the cloud Flow How to get unique ID of a cloud Flow run How to get link to a cloud run The trick to get these details is the workflow() expression, which returns all details about the workflow during run time. To add this into your Flow, simply use the expression:  workflow() A sample output of this expression is in below format: {      "id" :  "/workflows/e54ef274a2f14b54af75fabc3c3c86d3" ,      "name" :  "8a854a53-5863-47d1-acc9-c5993d8f48ff" ,      "type" :  "Microsoft.Logic/workflows" ,      "location" :  "westeurope" ,      "tags" : {        ...