Forum Discussion

VSTrath's avatar
VSTrath
Copper Contributor
Sep 23, 2021

Send an email when we assign a task in a list

Hi I'm trying to create a flow that sends an email to a user to let them know who is handling their enquiry.    My Sharepoint list has a choice column called 'Status'. I want the flow to trigger wh...
  • RobElliott's avatar
    Sep 24, 2021

    VSTrath yes you're flow will go into an infinite loop the way you have it. In my example below (prepared for a similar question) we are going to change the Status of the Bedar item below to Completed which will put in today's date in a different column, but it will not go into an infinite loop.

     

    Important: the flow compares the current version of the list with the previous version so you must turn on list item versioning in your list settings.

     

     

     

    In your flow do not use the when an item is created or modified trigger but use the SharePoint "when an item or a file is modified" and select your site and list:

     

     

    Next, the first action should be the SharePoint  "get changes for an item or a file (properties only)". Again you select your site and list and then in the Since field add the following expression to get the changes since the previous version:

    sub(int(triggerOutputs()?['body/{VersionNumber}']),1)

     

     

    Next, add a condition and select Has Column Changed: Status is equal to true

     

     

    In my example we are also checking if the Status is now completed, so I've added aother line in the condition and selected Status value is equal to Completed. the reason it's status value and not just status is  because in my list the status column is a choice column.

     

     

    You can leave the red if no channel empty because we don't want anything to happen in that case. But in the green if yes channel add an "update item" action and add the utcNow() expression for today's date

     

     

     

    In your scenario you would add the email action into the green if yes channel. And this flow avoids the infinite loop. 

     

    Come back with any questions about this.

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

Resources