Forum Discussion
Add date completed when status is changed
tomscrace yes this can be done with a simple flow in Power Automate. You MUST make sure that versioning is activated in your list settings.
In this example we'll change the status of Bedar to Completed:
This is the trigger:
Next, add the get the changes for an item or a file (properties only) action. In the Since field we need to check what has changed since the previous version, so add the expression:
sub(int(triggerOutputs()?['body/{VersionNumber}']),1)
Next, add a condition to check it's the Status column that has cahnged AND the status is Completed
If that is the case then update the item in the list with the current date and time in the Completed date/time column:
Rob
Los Gallardos
Microsoft Power Automate Community Super User
I just wanted to note that this flow works most of the time, but I came across an issue where the condition "has column changed" will run as false if more than just the Status field is updated (in my case, updating the Hours field as well). SharePoint will record each change as a separate version, and if they occur close enough together (I'm guessing within the same minute?), the flow will only consider the second update. I've solved this issue by updating the Since expression to look at the last 2 versions, rather than 1. I don't see any future issues with doing that, but is there a more elegant way to address the problem?