web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filling in the date wh...
Power Automate
Answered

Filling in the date when the status is changed im SharePoint List using Power Automate

(1) ShareShare
ReportReport
Posted on by 9

Hi all!

 

Sorry for very simple case. But i trying to create this a long time. 

 

So i need to fill in the current date when the "Task" in list changed to Completed status. I'm using trigger "

When an item or a file is modified", then i take a logical test using Condition or Switch to check the Status. At some point, it seemed to me that everything was working. But then I realized that the flow does this for all elements with this status.
 
How to make sure that conditions are applied in each case separately and do not affect all other elements?
 
Apply to each can not use coz: 
 
"The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body/ID']' is of type 'Integer'. The result must be a valid array."
catmint_0-1640791674408.png
Categories:
I have the same question (0)
  • Verified answer
    RobElliott Profile Picture
    10,428 Super User 2026 Season 1 on at

    @catmint your trigger is correct but the follow on actions are not. First you MUST make sure that item versioning is switched on in your list settings. This is because we will be comparing the current version to the previous one.

     

    So the trigger is:
    1-Flow.png

     

    Next, your first action should be "get changes for an item or a file (properties only)". You select the ID from the dynamic content box, then in the since field you need to add an expression to compare the current version with the previous one. That expression is:

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

    2-Flow.png

     

    Next, add a Condition to check if the Status column has changed, and if it has whether the status is now Completed (or whatever your statuses are):

    3a-Flow.png

     

    3b-Flow.png

     

    It needs to select Status Value, not Status, because my column in the SharePoint list is a Choice column.

     

    Finally, you update the item in the the list with the date the status was changed to completed, i.e. today:
    4-Flow.png

     

    Rob
    Los Gallardos
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

     

  • catmint Profile Picture
    9 on at

    Dear Rob,

     

    Thank you a lot. It works!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard