Forum Discussion

Amf0486's avatar
Amf0486
Copper Contributor
Jul 20, 2021

New User to Power Automate

Hello!

I am very new to using SharePoint and the functions it provides. But I am trying to make a flow where when I input the value of 'Completed', it will automatically trigger an email to be sent from the data I select from that row only. I don't want it to resend emails from previous rows.

I have searched through forums and YouTube and I don't really understand it. Please share your knowledge with me!
  • RobElliott's avatar
    RobElliott
    Silver Contributor

    Amf0486 the first thing you must do is in your SharePoint list go to List Settings and turn on item version history. This is because in the flow we'll be comparing the current version to the previous one to see what had changed.

     

    A flow always has 1 trigger and then multiple actions. The trigger in this case is a SharePoint when an item or a file is modified. Select your site and the list:

     

    Next we need to get the changes that have taken place since the previos version so add a get changes for an item or a file (properties only) action. Again, select your site and list, click in the ID field and select ID that appears in the dynamic content box on the right.

     

    Then click in the Since field and this is where we add an expression to get the changes since the previous 1 version. Over in the dynamic content box click the Expression tab and add (copy & paste) the following expression then click OK:

    sub(int(triggerOutputs()?['body/{VersionNumber}']),1)
     
    Leave the Until field empty.

     Next, we want to check if it was the Status column that had changed AND if the Status is now Completed. So add a Condition, click in the left hand box and from the dynamic content select Has column changed: Status then in the middle field select is equal to and in the right field type true - has column changed: column title is always a boolean true/false.

    Then click the +Add dropdown and add another row to the condition. This time I have selected Status Value is equal to Completed. The reason it's Status Value and not just Status is that in my list the Status column was a choice column and we are checking the value selected. In your list if your Status column is a single line of text column for example then you would just see Status in the dynamic content box.

     

    Finally, with a condition you always get a red "if no" channel and a green "if yes" channel. You can leave the red if no channel empty because we don't want anything to happen if a different column has changed or if the Status value is not Completed. But in the green if yes channel add a send an email (v2) action which will happen if the Status column is the column that has changed and if the status value is now Completed.

     

    In the body field type whatever text you want for the text and select the appropriate columns from the dynamic content box.

     

    In the send an email action click on Show advanced options and down at the bottom select Normal for the importance otherwise it will default to low.

     

    So the status column in the list is changed to Completed:

     And the email is sent. If any other column had changed, or if the status had changed to In Progress then the email wouldn't be sent - the flow would go down the red if no channel.

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

Resources