Forum Discussion
Modify a "Created By" Sharepoint List Column
- Feb 13, 2024
jtsables by default the Created By column is read-only but you can change it with the following flow which is triggered from a button in the SharePoint list/library.
The Uri field is
_api/web/lists/getByTitle('Site Pages')/items(ID)/validateUpdateListItemand the Body field is
{ "formValues":[ { "FieldName": "Author", "FieldValue": "[{'Key':'i:0#.f|membership|{OWNER EMAIL}@wsp.com'}]" }, { "FieldName": "Editor", "FieldValue": "[{'Key':'i:0#.f|membership|{OWNER EMAIL}@wsp.com'}]" } ], "bNewDocumentUpdate": true }Then create a single line of text column in your SharePoint list and format it in advanced mode with the following JSON, changing the flow ID to your flow and other parameters as necessary.
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "button", "txtContent": "Change Created By", "customRowAction": { "action": "executeFlow", "actionParams": "='{\"id\":\"5eddbaca-e7df-46f4-b968-f009ed9f69ec\", \"headerText\":\" ' + [$Title] + '\",\"runFlowButtonText\":\"Go\"}'" }, "style": { "background-color": "#fff5dd", "border-radius": "10px" } }Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
jtsables by default the Created By column is read-only but you can change it with the following flow which is triggered from a button in the SharePoint list/library.
The Uri field is
_api/web/lists/getByTitle('Site Pages')/items(ID)/validateUpdateListItem
and the Body field is
{
"formValues":[
{
"FieldName": "Author",
"FieldValue": "[{'Key':'i:0#.f|membership|{OWNER EMAIL}@wsp.com'}]"
},
{
"FieldName": "Editor",
"FieldValue": "[{'Key':'i:0#.f|membership|{OWNER EMAIL}@wsp.com'}]"
}
],
"bNewDocumentUpdate": true
}
Then create a single line of text column in your SharePoint list and format it in advanced mode with the following JSON, changing the flow ID to your flow and other parameters as necessary.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Change Created By",
"customRowAction": {
"action": "executeFlow",
"actionParams": "='{\"id\":\"5eddbaca-e7df-46f4-b968-f009ed9f69ec\", \"headerText\":\" ' + [$Title] + '\",\"runFlowButtonText\":\"Go\"}'"
},
"style": {
"background-color": "#fff5dd",
"border-radius": "10px"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)
Thank you very much for this way of doing which works very well.
However with this flow, every time someone edits an item, I have to manually enter that person's name.
I have a flow that isolates modifications made on a first spo list into a 2nd spo list. My goal would be to automatically update the 'Modified By' (or 'Created By') column of the 2nd spo list with the name of the person who made the modification (instead of the name of the author of the flow which is currently me)
Is there a way to do this automatically and integrate with my existing flow?