Forum Discussion
Flow changes "modified by" column
thank you for your answer.
How would I do that? I am quite new to power automate.
Can I combine this with the flow that ckecks if the field value is "used" and puts the current date to the date column?
Perhaps with a parallel branch --> get item "mydiefied by" field and then?
MichaelMr The flow for this is quite simple and you don't need parallel branches. But first you MUST make sure you have turned on item version history in the list settings as the flow needs to compare the current version with the previous version.
In this example we have a column for whether the item is in stock or used, A Date/Time column for the date it was changed from in stock to used and a single of texct column for who made that change. We are going to change the Bedar item.
The overall flow looks like this
So, the trigger is "when an item or a file is modified" and you select the site and list.
The first action is "get changes for an item or a file (properties only)". For the ID field you select ID from the dynamic content box. For the Since field you need to add the following expression into the Expression tab in the dynamic content box. This expression is what compares the current version to the previous one:
sub(int(triggerOutputs()?['body/{VersionNumber}']),1)
Next add a condition. From the dynamic content box select "Has column changed: Used", select is equal to and type in true
If that column HASN'T changed then we don't want the flow to do anything, so the red if no channel can be left empty.
But if the Used column HAS changed then in the green if yes channel add an update item action. Select ID, Title and any other required column from the dynamic content box. For the DateChanged column add an expression of utcNow() which means today. For the ChangedBy column I selected Modified By display Name, but you could select Modified By Email if you preferred.
The Bedar item was changed to Used, the flow ran and after a few seconds the ChangedDate and ChangedBy columns were updated (you might need to refresh the list to see the change).
Rob
Los Gallardos
Microsoft Power Automate Community Super User
- MichaelMrFeb 03, 2022Copper ContributorHi Rob,
I tried your solution, thank you ver much for that.
Unfortunately the flow return an error:
"Invalid format for version input value\r\nclientRequestId: c2592141-eca8-438e-8c1e-ef7d587f5703\r\nserviceRequestId: c2592141-eca8-438e-8c1e-ef7d587f5703"
Do you know what to do?- RobElliottFeb 03, 2022Silver Contributor
MichaelMr which action in the flow results is giving that error?
Rob
Los Gallardos
Microsoft Power Automate Community Super User- MichaelMrFeb 03, 2022Copper Contributor