How to create a list field for uploading images through rest api in SharePoint

63 Views Asked by At

I am at a loose of how to create a field for the user to upload images in the sharepoint list. The field has to be created through the rest api with the use of PowerAutomate

Tried looking for SP.Field equivalent and attributes like FieldTypeKind

1

There are 1 best solutions below

0
Ganesh Sanap - MVP On

Try using SharePoint API call in Power automate using "Send HTTP Request to SharePoint" with this information:

enter image description here

Method: POST

Uri:

_api/web/lists/getbytitle('My List Name')/fields/CreateFieldAsXml

Headers:

{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body:

{
    "parameters": {"SchemaXml": "<Field DisplayName='My Image Column' Format='Thumbnail' IsModern='TRUE' Name='MyImageCol' Title='MyImageCol' Type='Thumbnail'></Field>"}
}