Forum Discussion

IRademacher's avatar
IRademacher
Copper Contributor
Oct 07, 2021
Solved

Populate Date using Power Automate

I am attempting to have a flow that will run when a change is made and populate a "completion date" field. I have trialed a number of different flows and while the flow successfully runs, the date does not populate. Any guidance on where I have made a misstep would be greatly appreciated.

 

Thank you!

Irene

  • IRademacher The major problem is related to the get items action which should be get item action. That is then putting the update item in an apply to each where the field should be set to value. 

     

    However I would build this flow in a different way and look at whether just the Status had changed since the previous version of the item and if it had and was now Completed then add the date in. There are different triggers and actions for this as shown below. 

     

    Important: first you must turn on List item versioning in your list settings to be able to compare the current version with the previous one.

     

    So in our list we are going to look at whether the status column for Bedar had changed:

     

     

    The trigger for this in your flow is "when an item or a file is modified":

     

    The first action is "get changes for an item or a file (properties only)". Select ID from the dynamic content box. Then in the Since field add an expression to compare the item with the previous version:

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

     

     

    Next, add a condition and in the first row select Has Column Changed: Status is equal to true.

     

     

    Add another row to the Condition and select Status Value is equal to Completed:

     

    Finally in the green if yes channel add the "update item" action:

     

    So we change Bedar to Completed:

     

    the flow runs and after a few seconds adds the date and time into the date completed column.

     

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

     

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    IRademacher The major problem is related to the get items action which should be get item action. That is then putting the update item in an apply to each where the field should be set to value. 

     

    However I would build this flow in a different way and look at whether just the Status had changed since the previous version of the item and if it had and was now Completed then add the date in. There are different triggers and actions for this as shown below. 

     

    Important: first you must turn on List item versioning in your list settings to be able to compare the current version with the previous one.

     

    So in our list we are going to look at whether the status column for Bedar had changed:

     

     

    The trigger for this in your flow is "when an item or a file is modified":

     

    The first action is "get changes for an item or a file (properties only)". Select ID from the dynamic content box. Then in the Since field add an expression to compare the item with the previous version:

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

     

     

    Next, add a condition and in the first row select Has Column Changed: Status is equal to true.

     

     

    Add another row to the Condition and select Status Value is equal to Completed:

     

    Finally in the green if yes channel add the "update item" action:

     

    So we change Bedar to Completed:

     

    the flow runs and after a few seconds adds the date and time into the date completed column.

     

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

     

    • IRademacher's avatar
      IRademacher
      Copper Contributor
      Thank you, Rob! This has been very helpful and I have verified the updates are taking place!

Resources