Power Automate Exchange

Please login or click SIGN UP FOR FREE to create your FlowUG account to join this user group.
Expand all | Collapse all

Newbie Questions: Change Notification Flow Runs Twice, Messy "Click Here" link

  • 1.  Newbie Questions: Change Notification Flow Runs Twice, Messy "Click Here" link

    Posted Mar 31, 2021 07:47 AM
      |   view attached



    I'm a newbie to Power Automate; I've gone through a few courses in MS Learn to get started with rewriting my SharePoint 2010 workflows.  My company is planning to move from SP2013 to SharePoint Online in about a year.


    I'm having trouble rewriting a workflow that sends an email when the status of a document changes in a library.  In the SharePoint library, I have a status field and a previous status field.  On create or modify, the workflow compares the status and previous status fields – if they are not the same, an email is sent identifying the file name that changed, the new status, and a clickable link to the document.  The workflow then copies the status to the previous status field.  I'm replicating that process in the Power Automate flow.


    When rewriting the workflow into Power Automate:  1) the flow always runs twice, and 2) I haven't been able to figure out how to create a "Click Here" link in the email. 

    For #1, I know the second run is due to the action where I am updating the previous status field;  deleting the update action creates a single run of the flow.  But I need to be able to update the previous status field.  Any tips for accomplishing my goal?  I've attached an image of the flow I created.  I've spent the better part of a week trying to figure out what I am doing wrong.

    For #2, based on the examples I see online, it looks like I need to write an expression for the link to add to the href attribute in the email.  But I'm hitting a brick wall there as well, trying to write the expression – I don't see a link expression to start from in my Expressions dynamic content.


    I appreciate any advice, and would also really appreciate being pointed in the direction of any books or ebooks to help me get up to speed.  My well-worn Scott Shearer book on 2010 workflows needs a Power Automate replacement.


    Thank you for your help!


    Carol Anne


    Carol Anne T. Wall
    Engineering Senior Analyst – User Services
    Enterprise Technology

    400 Robert Street North, Mail Stop A4-7710, St. Paul, MN 55101-2098

    Securian Financial
    Securian Financial Group, Inc.


  • 2.  RE: Newbie Questions: Change Notification Flow Runs Twice, Messy "Click Here" link

    Posted Apr 08, 2021 06:32 AM
    Edited by Roisin Conlon Apr 08, 2021 06:33 AM
    Hi Carol Anne,

    I have had similar issues in the past where you are triggering a loop due to modifing an item that has a trigger of modified.

    The workaround would be to put your condition into the flow trigger rather than call the condition after the trigger.
    In the flow trigger settings, add a trigger condition as follows - @not(equals(triggerOutputs()?['body/Status'],triggerOutputs()?['body/PreviousStatus'])) - where body/status is your status column name and body/previousstatus is your previous column name.

    You may still see a warning inside your flow regarding an infinite loop but the trigger action will compare these two values and only run then when they are not equal therefore no second run after the previous status column has been updated and no wasted flows.

    Hope this helps

    Roisin Conlon