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
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
Hi @NagavalliPuli-7205 ,
I am currently doing some research on this issue, will let you know as soon as possible
@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 @NagavalliPuli-7205 ,
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://docs.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://docs.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.
@RaytheonXie-MSFT is there any way I can update SP.Taxonomy, and file modified by field
"I found that the rest api only works for list" -- but we are storing files in folders, how can convert relative path to list
sites/shared documents/test folder/child1/abc.txt
how can I convert the above path as list?
Hi @NagavalliPuli-7205 ,
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="Salaudeen@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.
@RaytheonXie-MSFT I need to update modified by from Angular 8 code (REST API),
using Client ID and Token, and user office Email
Hi @NagavalliPuli-7205 ,
Per my research, there is no such function to update modified by in library by rest api. I feel regretful to inform you that it turns out to be a by-design one.
7 people are following this question.