cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Change Created By or Modified by in SharePoint list

Hi,

I have a flow that populates a sharepoint list containing a list of users and some related informations.

When I run the flow, all the items are created and modified by the flow user.

I'd like to modify the created or modified by field with the username in order to create a sharepoint view filtered on this fields, this way a user could see only the informations related to himself.

Thanks for your help

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver II
Resolver II

Re: Change Created By or Modified by in SharePoint list

Unfortunately, you cannot edit the created by or modified by fields in SharePoint. You'll have to figure out a different way to create the views.  

If your list is a list of users are the users a person/group field? If they are you could use that field to filter the views instead of the created by or modified by fields.

View solution in original post

9 REPLIES 9
Highlighted
Resolver II
Resolver II

Re: Change Created By or Modified by in SharePoint list

Unfortunately, you cannot edit the created by or modified by fields in SharePoint. You'll have to figure out a different way to create the views.  

If your list is a list of users are the users a person/group field? If they are you could use that field to filter the views instead of the created by or modified by fields.

View solution in original post

Highlighted
Frequent Visitor

Re: Change Created By or Modified by in SharePoint list

Thanks for your answer, I'll manage it the way you mentionned!

Highlighted
Helper I
Helper I

Re: Change Created By or Modified by in SharePoint list

I wanted to mention that this is actually not correct anymore.  You can change the Created, Created By, Modified and Modified By using Microsoft Flow.  The FlowNinja John Liu shows you how in his post on the subject.  I think it all stemmed by from the whole created then update loop.   I have already used this for multiple Flows.  

 

In my case, I needed to update Created By to ensure that item-level permissions in a list worked correctly.  I checked my person field against Created By and if different, update it.  Works great!

Highlighted
Helper III
Helper III

Re: Change Created By or Modified by in SharePoint list

Hi  @dougallen  ! thank you for the information.I am working on a PowerApp application that is linked to a SharePoint List, and would like to override the "Created by"from the from PowerApp when it is created to only show an specific email. This is in order to control the access from the user to the SP List.

Was hopping you might know a solution for this question,

Thank you in advance!

Veronica

Highlighted
Anonymous
Not applicable

Re: Change Created By or Modified by in SharePoint list

Hi @dougallen ,

 

I am trying to change the Created By column to display the user who has created the item on sharepoint list. In my case, the person who creates the item on Sharepoint could be any user.

 

Due to the 'Create Item' command i have in my flow, sharepoint by default autopopulates this field with my user name (as i am the flow owner). In this case, the person who creates the item on Sharepoint could be any user. 

 

I was looking at the post which you said helped you, however, in the post, the author has already a designated user which he would like to assign in the Modified By column.

 

Do you know the way to change the user in the Created By from me to the user who actually created the item on SP?

 

Regards,

I

Highlighted
New Member

Re: Change Created By or Modified by in SharePoint list

It works for "editor" field but not the "Author" field . Did you have to do some additional changes to achieve this ?

Highlighted
New Member

Re: Change Created By or Modified by in SharePoint list

@dougallen : We are able to change the "Editor" field (Modified By)  but we are not able to change the "Author" field( Created By). Did you do some additional changes in order to achieve this ?

Highlighted
New Member

Re: Change Created By or Modified by in SharePoint list

Not relevant to Power Automate, however with PowerShell you can change both Created By and Author:

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
   
##Variables for Processing 
## NOTE: You can get the ID of the item in the Document Library by adding the ID Column 
$SiteUrl = "https://contoso.sharepoint.com/sites/sales/"
$ListName= "Projects"
$ID=6
$UserID="YourUser@contoso.com"
 
#Get Credentials to connect
$Cred = Get-Credential
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
 
#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl)
$Ctx.Credentials = $Credentials
 
#Get the User
$User = $Ctx.Web.EnsureUser($UserID)
$ctx.Load($user)
 
#Get the list Item
$List=$Ctx.Web.Lists.GetByTitle($ListName)
$ListItem = $List.GetItemById($ID)
$Ctx.Load($ListItem)
 
#update created by column sharepoint online powershell
$ListItem["Author"] = $User
#Update Modified By
$ListItem['Editor'] = $User
  
#Update List item
$ListItem.Update()
$ctx.ExecuteQuery()
 
Write-host "Metadata values updated Successfully!" -f Green

I got this from a blog that Salaudeen Rajack posted.

Highlighted
Frequent Visitor

Re: Change Created By or Modified by in SharePoint list

I wrote up a how-to guide to accomplish this, because existing examples lacked a completed front to back process to follow.

https://powerusers.microsoft.com/t5/Community-Chat-Announcements/Update-the-Created-By-AuthorID-Fiel...

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,118)