Forum Discussion
jtsables
Feb 13, 2024Copper Contributor
Modify a "Created By" Sharepoint List Column
Hi Team, I have a sharepoint list with a column "Created By". This is a default column created automatically with the list. I want to create a flow to add the name who appears in this col...
- 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)
Feb 13, 2024
You can do it with HTTP connector:
https://techcommunity.microsoft.com/t5/power-apps-power-automate/update-created-by-and-modified-by-fields/m-p/3672675/highlight/true#M6072
https://techcommunity.microsoft.com/t5/power-apps-power-automate/update-created-by-and-modified-by-fields/m-p/3672675/highlight/true#M6072