@RaytheonXie_MSFT Thank you for your support, this would be a great help, if you provide me the documentation how can I update file 'modified by' and 'security classification' fields. using relative path.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi Team,
I am trying to update user type field modified by and taxonomy field Security_x0020_Classification using SharePoint REST API call using OAuth token. but I am unable to do that please find the screenshot
@RaytheonXie_MSFT Thank you for your support, this would be a great help, if you provide me the documentation how can I update file 'modified by' and 'security classification' fields. using relative path.
Hi @Nagavalli Puli ,
Per my research, The REST API does not currently support working with Managed Metadata or Taxonomy fields. If you look at the REST API reference you'll find no mention of SP.Taxonomy or anything under SP.Taxonomy
https://learn.microsoft.com/en-us/previous-versions/office/developer/sharepoint-rest-reference/jj860569(v=office.15)?redirectedfrom=MSDN
After trying to update 'modified by', I found that the rest api only works for list but not document library. Here is a similar issue with yours for reference.
https://learn.microsoft.com/en-us/answers/questions/293328/is-there-a-rest-api-to-modifyupdate-readonly-prope.html
As a workaround, you can update 'modified by' by powershell
https://www.sharepointdiary.com/2016/11/update-created-by-modified-by-created-at-modified-at-values-using-powershell.html
Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi @Nagavalli Puli ,
For modified by field, you can refer to the following powershell script
#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
$SiteUrl = "https://crescent.sharepoint.com/sites/sales/"
$ListName= "Projects"
$ID=6
$UserID="******@crescent.com"
$TimeStamp = "2015/12/01 02:10:00 AM"
#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
#Set Created on & Modified on Time values
$ListItem["Created"] = $TimeStamp
$ListItem["Modified"] = $TimeStamp
#Update List item
$ListItem.Update()
$ctx.ExecuteQuery()
Write-host "Metadata values updated Successfully!" -f Green
For SP.Taxonomy, as far as I know, there is no such function to update Taxonomy by rest api after doing some research.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.