Get 'Modified By' From SharePoint List In Power Automate

Introduction

Power automation is a most essential and effortless platform where you can able to connect all the softwares and databases through integration. When Power Apps came as a preview (History Of Power Apps) in 2016, Power Automate was also introduced into it as Microsoft Flows. There were less number of connectors than now. Nowadays, we can able to connect everything with flows and do our job. Mostly people are working with Sharepoint to store data and make some reports with Power BI.

I was working on the Canvas app, and there was one requirement where I needed to send an email to the Manager if I was updating the SharePoint list item, and the email body contains the who has modified the list item. We will see how we can get the modified by and how we can use it while sending the email.

  1. The trigger point of the flow will be "When an item or a file is modified", we can select the site address and the list where that is modified.trigger point
  2. Later, add the action "Get Changes for an item or a file (properties only)."
    properties only

Here are the values of the above action.

$siteAddress = "your site address"
$listOrLibraryName = "List name"
$id = @{triggerOutputs()?['body/ID']}?
$since = @{triggerOutputs()?['body/{TriggerWindowStartToken}']}
$until = @{triggerOutputs()?['body/{TriggerWindowEndToken}']}
$includeMinorVersions = "No"

There are 2 properties in this action that are required to get the modified values.

  • Since: Trigger Window Start Token – the time that the flow last checked.
  • Until: Trigger Window End Token – the time of the current flow check.

When we trigger the flow, we can able to see what the trigger action will look like.

 trigger action

Later we can check if the list item column has changed; if it has changed, then only we are going to send an email.

item column

If the column has been modified, then we can send an email. Before sending an email, we can create an Email body into Compose action, and we can add the fields wherever it is required. My email body will contain the Modified By user name that we can get from triggerBody().

 triggerBody()

When the email has been sent, the email will be received, and it will show the modified user name.

 email

I hope this will be helpful for you to create the flow with SharePoint.

Keep learning new things.