Flow changes "modified by" column

%3CLINGO-SUB%20id%3D%22lingo-sub-3109416%22%20slang%3D%22en-US%22%3EFlow%20changes%20%22modified%20by%22%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3109416%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20flow%20that%20automatically%20runs%20if%20a%20certain%20column%20is%20changed%20in%20a%20list.%20The%20value%20of%20the%20field%20gets%20changed%20from%20%22in%20stock%22%20to%20%22used%22%20and%20triggers%20the%20flow%20that%20enters%20the%20current%20date%20into%20another%20column.%3C%2FP%3E%3CP%3EUnfortunately%20this%20also%20changes%20the%20%22modified%20by%22%20column%20back%20to%20my%20name%20because%20it%20it%20%22my%22%20flow%20that%20runs%20and%20the%20name%20of%20the%20person%20that%20changed%20the%20used%2Finstock%20field%20gets%20overwritten.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20the%20a%20way%20the%20keep%20the%20name%20of%20the%20person%20that%20changed%20the%20used%2Fin%20stock%20field%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3109416%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Flow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3109555%22%20slang%3D%22en-US%22%3ERe%3A%20Flow%20changes%20%22modified%20by%22%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3109555%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1268616%22%20target%3D%22_blank%22%3E%40MichaelMr%3C%2FA%3E%26nbsp%3BNo%20you%20can't%20change%20that%20behaviour%2C%20you%20would%20need%20a%20different%20column%20for%20holding%20the%20details%20of%20who%20had%20changed%20the%20used%2Fin%20stock%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3109577%22%20slang%3D%22en-US%22%3ERe%3A%20Flow%20changes%20%22modified%20by%22%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3109577%22%20slang%3D%22en-US%22%3EHi%20Rob%2C%3CBR%20%2F%3Ethank%20you%20for%20your%20answer.%3CBR%20%2F%3E%3CBR%20%2F%3EHow%20would%20I%20do%20that%3F%20I%20am%20quite%20new%20to%20power%20automate.%3CBR%20%2F%3ECan%20I%20combine%20this%20with%20the%20flow%20that%20ckecks%20if%20the%20field%20value%20is%20%22used%22%20and%20puts%20the%20current%20date%20to%20the%20date%20column%3F%3CBR%20%2F%3EPerhaps%20with%20a%20parallel%20branch%20--%26gt%3B%20get%20item%20%22mydiefied%20by%22%20field%20and%20then%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3109870%22%20slang%3D%22en-US%22%3ERe%3A%20Flow%20changes%20%22modified%20by%22%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3109870%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1268616%22%20target%3D%22_blank%22%3E%40MichaelMr%3C%2FA%3E%26nbsp%3BThe%20flow%20for%20this%20is%20quite%20simple%20and%20you%20don't%20need%20parallel%20branches.%20But%20first%20you%20MUST%20make%20sure%20you%20have%20turned%20on%20item%20version%20history%20in%20the%20list%20settings%20as%20the%20flow%20needs%20to%20compare%20the%20current%20version%20with%20the%20previous%20version.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%220-SP-Versions.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344968iBBFEF8A5156C0F09%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%220-SP-Versions.png%22%20alt%3D%220-SP-Versions.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EIn%20this%20example%20we%20have%26nbsp%3B%20a%20column%20for%20whether%20the%20item%20is%20in%20stock%20or%20used%2C%20A%20Date%2FTime%26nbsp%3B%20column%20for%20the%20date%20it%20was%20changed%20from%20in%20stock%20to%20used%20and%20a%20single%20of%20texct%20column%20for%20who%20made%20that%20change.%20We%20are%20going%20to%20change%20the%20Bedar%20item.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%220-SP-List.png%22%20style%3D%22width%3A%20867px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344965iC95E56D353B00EA5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%220-SP-List.png%22%20alt%3D%220-SP-List.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20overall%20flow%20looks%20like%20this%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%220-Flow-Overall.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344967i742045042CF7FB43%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%220-Flow-Overall.png%22%20alt%3D%220-Flow-Overall.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3BSo%2C%20the%20trigger%20is%20%22%3CSTRONG%3Ewhen%20an%20item%20or%20a%20file%20is%20modified%3C%2FSTRONG%3E%22%20and%20you%20select%20the%20site%20and%20list.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221-Flow.png%22%20style%3D%22width%3A%20781px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344973iABD65A1D5D37B793%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%221-Flow.png%22%20alt%3D%221-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20first%20action%20is%20%22%3CSTRONG%3Eget%20changes%20for%20an%20item%20or%20a%20file%20(properties%20only)%3C%2FSTRONG%3E%22.%20For%20the%20ID%20field%20you%20select%20ID%20from%20the%20dynamic%20content%20box.%20For%20the%20Since%20field%20you%20need%20to%20add%20the%20following%20expression%20into%20the%20Expression%20tab%20in%20the%20dynamic%20content%20box.%20This%20expression%20is%20what%20compares%20the%20current%20version%20to%20the%20previous%20one%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20color%3D%22%23BF00BF%22%3E%3CSPAN%3Esub(int(triggerOutputs()%3F%5B'body%2F%7BVersionNumber%7D'%5D)%2C1)%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221a-Flow.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344975i3C3474CBD3A25210%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%221a-Flow.png%22%20alt%3D%221a-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENext%20add%20a%20condition.%20From%20the%20dynamic%20content%20box%20select%20%22%3CSTRONG%3EHas%20column%20changed%3A%20Used%3C%2FSTRONG%3E%22%2C%20select%20is%20equal%20to%20and%20type%20in%20true%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%222-Flow.png%22%20style%3D%22width%3A%20919px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344969i1EDCD4C25F4F6270%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222-Flow.png%22%20alt%3D%222-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20that%20column%20HASN'T%20changed%20then%20we%20don't%20want%20the%20flow%20to%20do%20anything%2C%20so%20the%20red%20if%20no%20channel%20can%20be%20left%20empty.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20if%20the%20Used%20column%20HAS%20changed%20then%20in%20the%20green%20if%20yes%20channel%20add%20an%20%3CSTRONG%3Eupdate%20item%3C%2FSTRONG%3E%20action.%20Select%20ID%2C%20Title%20and%20any%20other%20required%20column%20from%20the%20dynamic%20content%20box.%20For%20the%20DateChanged%20column%20add%20an%20expression%20of%20%3CSTRONG%3EutcNow()%3C%2FSTRONG%3E%20which%20means%20today.%20For%20the%20ChangedBy%20column%20I%20selected%20Modified%20By%20display%20Name%2C%20but%20you%20could%20select%20Modified%20By%20Email%20if%20you%20preferred.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%223-Flow.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344970i3675C056DA8DE1AB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%223-Flow.png%22%20alt%3D%223-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20Bedar%20item%20was%20changed%20to%20Used%2C%20the%20flow%20ran%20and%20after%20a%20few%20seconds%20the%20ChangedDate%20and%20ChangedBy%20columns%20were%20updated%20(you%20might%20need%20to%20refresh%20the%20list%20to%20see%20the%20change).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%224-SP-Result.png%22%20style%3D%22width%3A%20747px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F344971i721332370C6052C9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%224-SP-Result.png%22%20alt%3D%224-SP-Result.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3110949%22%20slang%3D%22en-US%22%3ERe%3A%20Flow%20changes%20%22modified%20by%22%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3110949%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20SharePoint%20connector%20does%20not%20have%20this%20ability%3B%20however%2C%20the%20Dataverse%20one%20does.%3C%2FP%3E%3CP%3EJust%20point%20this%20out%20in%20case%20this%20is%20an%20option.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DonalMcCarthy_0-1643895622162.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F345014i50AD651CCE7F1626%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22DonalMcCarthy_0-1643895622162.png%22%20alt%3D%22DonalMcCarthy_0-1643895622162.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3111784%22%20slang%3D%22en-US%22%3ERe%3A%20Flow%20changes%20%22modified%20by%22%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3111784%22%20slang%3D%22en-US%22%3EHi%20Rob%2C%3CBR%20%2F%3E%3CBR%20%2F%3EI%20tried%20your%20solution%2C%20thank%20you%20ver%20much%20for%20that.%3CBR%20%2F%3EUnfortunately%20the%20flow%20return%20an%20error%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%22Invalid%20format%20for%20version%20input%20value%5Cr%5CnclientRequestId%3A%20c2592141-eca8-438e-8c1e-ef7d587f5703%5Cr%5CnserviceRequestId%3A%20c2592141-eca8-438e-8c1e-ef7d587f5703%22%3CBR%20%2F%3E%3CBR%20%2F%3EDo%20you%20know%20what%20to%20do%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3112001%22%20slang%3D%22en-US%22%3ERe%3A%20Flow%20changes%20%22modified%20by%22%20column%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3112001%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1268616%22%20target%3D%22_blank%22%3E%40MichaelMr%3C%2FA%3E%26nbsp%3Bwhich%20action%20in%20the%20flow%20results%20is%20giving%20that%20error%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello,

 

I have flow that automatically runs if a certain column is changed in a list. The value of the field gets changed from "in stock" to "used" and triggers the flow that enters the current date into another column.

Unfortunately this also changes the "modified by" column back to my name because it it "my" flow that runs and the name of the person that changed the used/instock field gets overwritten.

 

Is the a way the keep the name of the person that changed the used/in stock field?

14 Replies

@MichaelMr No you can't change that behaviour, you would need a different column for holding the details of who had changed the used/in stock column.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

Hi Rob,
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.

 

0-SP-Versions.png

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.

0-SP-List.png

 

The overall flow looks like this

 

0-Flow-Overall.png

 

 So, the trigger is "when an item or a file is modified" and you select the site and list.

 

1-Flow.png

 

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)

 1a-Flow.png

 

Next add a condition. From the dynamic content box select "Has column changed: Used", select is equal to and type in true

 

2-Flow.png

 

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.

 

3-Flow.png

 

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).

 

4-SP-Result.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

The SharePoint connector does not have this ability; however, the Dataverse one does.

Just point this out in case this is an option.

 

DonalMcCarthy_0-1643895622162.png

 

Hi 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?

@MichaelMr which action in the flow results is giving that error?

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@MichaelMr This is a known behavior if you are updating the list item from flow using Standard SharePoint connector action.

 

If you want to set the name of user who changed the list item in Modified By field, you can use ValidateUpdateListItem API call to update list item from flow. 

 

Check this article for more information: modifying Modified By and Modified time with Microsoft Flow 


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.

@ganeshsanap that hasn't worked for over year as far as I remember from other forum posts.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott 

 

Hi Rob,

the "get changes for an item or file (properties only)" is returning the error.

 

1.png

@MichaelMr if you could show (in edit mode) both the trigger and the first action that would probably help me solve it. Thanks.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott 

 

Hi Rob,

 

of course:

 

first step is to set the trigger,

second one is the step from your post,

third step to create a timestamp for my "date used" column,

then the conditions: "used" column hast to be "used", "date used" column has to be empty,

and the condition from your post "... has changed"

1.png2.png

@MichaelMr the error is because you have typed the "Since" expression directly in the field which is incorrect. Click in the field and over in the dynamic content box click the Expression tab. Enter the expression there and click OK. This was shown in my earlier screenshots but is shown again below. 

 

1a-Flow.png

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott 

Hi Rob,

thank you. That solved the problem.

One additional question:
The flow works fine as long as the original "modified by" column is visible in the list. If I hide the "modifiedy by" colum the flow runs without error but nothing is entered in the new "ChangedBy" column.
How can I solve this?

@MichaelMr there must be some other issue, I didn't have the Modified BHy column visible in my list.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User