0

I am looking for documentation to manage folder columns and ability to create the columns if not exists on the folder and set the values of these columns on the item using SharePoint REST APIs.

_api/web/GetFolderById(guid'<>') gets me the folder.

But how to get the columns on the folder and how to create/update for items?

If anyone can point me to the documentation for all this would be great.

1 Answer 1

0

Found how pasting here if someone faces the same issue.

_api/web/GetFolderById(guid'<UniqueId>')}')/Properties

using the property vti_x005f_listid:

_api/web/lists(guid'<list_id>')/Fields

to create field use same as above using POST, make sure the headers below

"Accept": "application/json;odata=verbose"
"Content-Type": "application/json;odata=verbose"

{
  "__metadata": {
    "type": "SP.Field"
  },
  "Title": "field title",
  "FieldTypeKind": 2, //single line 
  "Required": "true/false",
  "EnforceUniqueValues": "true/false",
  "StaticName": "field name"
}

using the file as list item you can update the value similar to as you do with listitem.GetItemByUniqueId which can be retrieved from the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.