Disclaimer: There are a few steps required to get this done, but the reward at the end is worth the effort.
Get Created By field GUID
To update the Created By column, we need to first find it’s Field GUID. Because the Created By column is set to read only, we will query our list for all fields but filter them to only show ones set ReadOnlyField = true
Get UserID Number to write to Created By column
Created By is a person column that has an associated AuthorId field. The AuthorId field contains a numeric value (ie: 11) which is used to populate the Created By person data. Our end goal (soon)-- to simply update this field to the numeric value of the user we want listed in the Created By column.
First we need to get our replacement numeric value from somewhere. In the following example I look up a sharepoint users numeric value, simply by supplying their email address (in the example this was dynamic content supplied by a person column in my list called 'EmployeeName')
Unlock the Created By column
Now that we have taken care of all the prerequisites, let’s get on with unlocking the column for manual updating. The column is locked by SharePoint automatically after a record gets updated - if you don't unlock it before attempting to update it's contents, the column doesn't get changed.
Create a new Send HTTP Request to SharePoint action. Fill in, adjust according to your tenant/list/Created By fields GUID, match the rest.
Uri: _api/web/lists/getbytitle('Your%20List%20Name')/fields(guid'Your-GUID-goes-here-yasss')
Body: { '__metadata': { 'type': 'SP.Field' }, 'ReadOnlyField': false }
Update the Created By field
Now that the Created By column is unlocked, we can update its fields.
Create a new Send HTTP Request to SharePoint action. Fill in, adjust accordingly to your tenant/list, match the rest.
Uri: _api/web/lists/getbytitle('Your%20List%20Name')/items('[ID]')
The ID you should be able to plug in from dynamic content from other actions (ie: Get Items, When a New Item is Created, etc)
Body: { '__metadata': { 'type': 'SP.Data.Your_x0020_List_x0020_NameListItem' }, 'AuthorId': [Id] }
For the [Id] shown, we plug in some dynamic content from our Parse JSON Action. Note: !pay attention here to cAse. Use the dynamic content Id (uppercase i lowercase d) -- and not id (all lowercase) when you choose.
Re-lock the Created By column
Now we can set the Created By column back to read-only.
Create a new Send HTTP Request to SharePoint action. Fill in, adjust according to your tenant/list/Created By fields GUID, match the rest.
Uri: _api/web/lists/getbytitle('Your%20List%20Name')/fields(guid'Your-GUID-goes-here-yasss')
Body: { '__metadata': { 'type': 'SP.Field' }, 'ReadOnlyField': true }
I spent the better part of a day sifting through bits and pieces from various forums -- most of them producing more questions than solutions. Hopefully, you find this helpful (and save yourself some time).
-F
Helloe Fraser
Your steps are detailed however as a non programmer iam not able to use it across for my scenario.
Could this technique be used dynamically to update a Sharepoint list item that has been copied from another list?
I have flow that that copies across from list 1 to list 2 if the user ticks a yes.
I would like the flow to update the created by or modified by field for the copied item through the same flow while its being created or updated.
All help is appreciated.
Hi @FraserM Would this work the same for editing the Created By column in a document library, rather than a list?
I've tried to follow this through and am able to amend other columns, just not the AuthorID/EditorID so I'm guessing the field isn't unlocking for me to edit but I'm not sure why. It might just be I'm getting the wrong FieldID.
Any help greatly appreciated.
Here's my current HTTP request to unlock the field
I follow all the steps and the result is ok in the flow, but don´t change the Author in the list, I test it changing the ID, but still continue with the same author ID
I'm trying to anonymize entries in a SharePoint list that are more than one year old, that is, I would like to change all Created By for those entries to "Anonymous".
I imagine that I can skip the Parse JSON part of the above manual. When I'm running the last Send an HTTP request to SharePoint, I'm getting an error message, saying that the format is incorrect. The details shows it's something to do with the items('[ID]').
This is what I have at the moment:
Do you have any suggestions on how to achieve a flow that would allow me to anonymize data that is older than one year?
Hello Fraser,
thanks for your instructions.
I'm trying your solution, but the AuthorId stubbornly keeps its original value.
Do you know if something has changed why this wouldn't be working anymore?
Kind regards,
Frans
Hi,
I am hitting an error on the step where it tries to update the created by field but i am getting :
I was able to figure out the issue. Schema was not all there when i generated a sample so recreating that resolved my invalid JSON error.
IF you follow the instructions, you should have no issues. if you do run into problems, i would suggest double checking every config against the posts and if you continue to have issues, rebuilding the components or checking your schema should resolve most issues.
I've been through this several times and I'm missing something.
I get an error on the UpdateCreatedBy request:
A 'PrimitiveValue' node with non-null value was found when trying to read the value of a navigation property; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.
My Unlock step (below) works fine. I can even do a GET request after this, read the fields as described (omitting the 'read only' filter, and confirm that the read only flag changes to false.
Here is my UpdateCreatedBy.. step:
Body field contains: { '__metadata': {'type': 'SP.Data.FlowtestListItem'},'AuthorID': 59}
I manually entered the item id (confirmed it exists!) and the Author Id (found per another GET request). I will change them to be dynamic content when the Flow test run is working.
Note that I changed AuthorID to Author. Author is what shows up as the "InternalName" and "StaticName" slightly above the "Title": "Created By" as found via the GET step to find the GUID.
If I have 'AuthorID' in my body field I get this error:
The property 'AuthorID' does not exist on type 'SP.Data.FlowtestListItem'. Make sure to only use property names that are defined by the type.
In case it helps, here's the raw input that I can pull after the Flow test fails:
@lukaszpudlo The [ID] at the end of the Uri is dynamic content . It will be a numeric value that corresponds with the row number of the item being processed. ie: /items(1) i think would be the first row in the list.
(I can see from the screenshot you are currently just typing in [ID] )
Uri: _api/web/lists/getbytitle('Your%20List%20Name')/items('[ID]')
Next, where you have typed 'Anonymous' that won't work. That field is a numeric value assigned to all sharepoint users (and not a string of text as you have typed in). I have updated my original post above to better explain this - try passing a value in there just for fun.. say 1 or 2 just for fun 😉
Body: { '__metadata': { 'type': 'SP.Data.Your_x0020_List_x0020_NameListItem' }, 'AuthorId': [Id] }
As for an idea on how to anonymize after a year.. possibly. From what I can see you want to set it to 'Anonymous' so why not create a user in O365/SharePoint called Anonymous, use the LookupSPUserId method i outlined to grab the associated Id numeric value and then run a scheduled flow to check for entries aged to fit your criteria, and set the AuthorId field on them. You should be able to use an user@tenant.onmicrosoft.com address also so you wont need to assign any licenses. Follow up info here should you need to poke sharepoint to create the user object (post by Tiago Paes)
@rl17 you are super close on yours.
I re-read your post and I think I know what the problem is.
Take a look here. I'm willing to bet you renamed it from something else TO flowtest at some point along it's life. As a result, what you are passing in the body for 'Flowtest' isn't matching.
There is a way to get a list of all your columns (or "Field") info. Note: it's per view (ie: All Items, etc)
Method: POST
Uri: _api/web/lists/getbytitle('ListName')/views/getbytitle('View%20Name')/viewfields
check the outputs... here's all your column names
Easiest way to fix it:
1. delete the flowtest column
2. recreate it using Flowtest as the name.
3. Change back to AuthorId in the Body section (Author is def not going to work) (here's a lot of discussion about it and it all shows updating the AuthorId field.. was low hanging fruit while looking for supporting evidence)
4. Try your flow again. Did that work?
Feeling like a wild goose chase... I appreciate your suggestions @FraserM
I followed your first link, which, if I read correctly, was intended to confirm the name of the list.
I sent the command (via web browser):
https://________.sharepoint.com/sites/QualityManagement/_api/web/lists/getbytitle('flowtest')?$selec...
and got as a return: a whole bunch of stuff plus:
<updated>2021-03-19T22:55:51Z</updated><author><name /></author><content type="application/xml"><m:properties><d:ListItemEntityTypeFullName>SP.Data.FlowtestListItem</d:ListItemEntityTypeFullName></m:properties></content></entry>
So it looks pretty clear that it expects FlowtestListItem - which is fine, and matches what I had already found by my guess-and-check method. 🙂
After that, I tried the next part of your post, so I sent (again, just in a browser for the sake of speed):
https://_______.sharepoint.com/sites/QualityManagement/_api/web/lists/getbytitle('flowtest')/views/g...
(I have a view called ByPerson which shows the 'Created By' field that I want to change)
Which returned a whole bunch more, including:
So again, "Author" shows up, and not "AuthorID".
Not sure what you mean about deleting the 'flowtest' column - 'flowtest' is the name of my list, but there are no columns with that name.
In the body section of my UpdateCreatedBy step, changing to 'AuthorID' gives me the same error I had before:
The property 'AuthorID' does not exist on type 'SP.Data.FlowtestListItem'. Make sure to only use property names that are defined by the type.
clientRequestId: bc0292ac-5ba0-4647-92fc-30102f15534c
serviceRequestId: eceeb59f-505b-b000-e270-842485749fcc
Looked at your link in Step 3 - I agree that it all points to AuthorID - which is why I'm confused about the above error. The discussion in that link includes another call to find out if the field is read-only or not:
I can sift through the output from that and I do see ReadOnly="FALSE" (and plenty of references to 'Author' and no references to 'AuthorID').
Circles back to where I was before... if I put 'AuthorID' in the body call I get the 'property does not exist' error, and if I use 'Author' instead I get the 'PrimitiveValue node' message from my first post.
Again, I do appreciate the thoughts and effort into sorting this out. I hope it speaks to some deeper issue that Power Automate could really be simpler for the end-user!
Hello!
@FraserM I did everything like you wrote but I am getting an error in Parse JSON step: Unable to process template language expressions in action 'Parse_JSON' inputs at line '1' and column '10316': 'Required property 'content' expects a value but got null. Path ''.'.
One step above I am getting data in Output so its not null or empty:
This is my shema in Parse JSON step:
{
"type": [
"object",
"null"
],
"properties": {
"d": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"uri": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"Alerts": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"uri": {
"type": "string"
}
}
}
}
},
"Groups": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"uri": {
"type": "string"
}
}
}
}
},
"Id": {
"type": "integer"
},
"IsHiddenInUI": {
"type": "boolean"
},
"LoginName": {
"type": "string"
},
"Title": {
"type": "string"
},
"PrincipalType": {
"type": "integer"
},
"Email": {
"type": "string"
},
"Expiration": {
"type": "string"
},
"IsEmailAuthenticationGuestUser": {
"type": "boolean"
},
"IsShareByEmailGuestUser": {
"type": "boolean"
},
"IsSiteAdmin": {
"type": "boolean"
},
"UserId": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"NameId": {
"type": "string"
},
"NameIdIssuer": {
"type": "string"
}
}
},
"UserPrincipalName": {
"type": "string"
}
}
}
}
}
Do you know what is wrong?
If you watch this video ... you will level up about twice in twenty minutes 😉
https://www.youtube.com/watch?v=kk2dfIcwOn8
trust me...
the error looks like its related to schema. its expecting a value somewhere and not receiving one.
in that video he talks about trimming down the data that goes into the schema generator/example. pay close attention to that 😉 and i think you've got it
Thanks a lot 🙂 everything working fine now.
I got another question/idea now. Can we set sharepoint/aad group as a CreatedBy same like User?
Wow impressive.
Need to use thos tipe to find my Sp.data A type named ’SP.Data.ListItem’ could not be resolved by the model - Fabozzi's Compiled Knowledge.
Works like a charm by default.
Is it possible to update the created date also ?
I add a action send http - I highlighted in yellow the GUID of the created column
but i don't know how to update the created column
Do you know how @FraserM ?
Thanks for the reply
Forget it, I change CreatedID by Created and it works.
Thank you for the incredible Works. Thank you, you save me
Hi, this is very useful (and it got me to learn something about Json). However I get a 401 (unauthorised) error on the unlock field command.
I checked the parameters (site/list and field GUID) and they seem to be correct.
I'm the owner of the list, and have edit access to the site, but I'm not a Sharepoint admin.
What level of access is needed to the Sharepoint site and list?
Thanks
Andreas
I'm not sharepoint admin and it works for me.
Dear Community Members, We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd. During this period, members will not be able to Kudo, Comment, or Reply to any posts. On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities. What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!
We are excited to announce the Summer of Solutions Challenge! This challenge is kicking off on Monday, June 17th and will run for (4) weeks. The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities. Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”) - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024 Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods. You must enter into each weekly Entry Period separately. How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different. Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers. At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing. Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner. A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random. Individuals will be contacted before the announcement with the opportunity to claim or deny the prize. Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners. Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event. ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE** Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24 17 @Anil_g 7 @ManishSolanki 13 @eetuRobo 5 @David_MA 10 @VishnuReddy1997 5 @SpongYe 9JhonatanOB19932 (tie) @Nived_Nambiar 8 @maltie 2 (tie) @PA-Noob 2 (tie) @LukeMcG 2 (tie) @tgut03 2 (tie) Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate @Deenuji 12@ManishSolanki 19 @Anil_g 10 @NathanAlvares24 17 @VishnuReddy1997 6 @Expiscornovus 10 @Tjan 5 @Nived_Nambiar 10 @eetuRobo 3 @SudeepGhatakNZ 8 Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22 Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2 Anil_g2 SharonS2
On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners. The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights. Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.
We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for. We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer. Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together. Here's to new beginnings and endless possibilities! If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport. To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages