How to Create an Image Column in SharePoint List Using Power Automate REST API

Last week, while working on a digital product called “Create SharePoint list and columns dynamically from an Excel file using Power Automate“, I needed to automatically create an Image column in a SharePoint Online list.

Normally, we can manually create an Image column from the SharePoint list settings. However, in automated provisioning solutions, especially when generating SharePoint lists and columns dynamically from Excel or JSON configurations, we may need to create the Image column programmatically using the REST API.

After some research, I found that SharePoint Online internally stores the Image column as a Thumbnail field type. Using the Send an HTTP request to SharePoint action in Power Automate, we can create the Image column dynamically by using the CreateFieldAsXml REST API endpoint.

In this tutorial, I will explain step by step how to create an Image column in a SharePoint Online list using the Power Automate REST API.

Create an Image Column in SharePoint List Using Power Automate REST API

Now, let’s see how to create an Image column in a SharePoint list using the Send an HTTP request to SharePoint action.

For this example, I have a SharePoint list named:

Employee Birthday
How to Add an Image to a Microsoft Lists Image Column using Power Automate

Now, I want to create an Image column named:

Employee Photo

To create the Image column, follow the steps below:

  1. Go to Power Automate.
  2. Select Create and then choose Instant cloud flow.
  3. Enter a flow name, such as:
Create Image Column in SharePoint List
Add an image to SharePoint Image columns using Power Automate
  1. Select the Manually trigger a flow trigger and click Create.
  2. Next, add the SharePoint action: Send an HTTP request to SharePoint
  3. In the Send an HTTP request to SharePoint action, provide the information below.
    • Site Address: Select your SharePoint site address.
    • Method: POST
    • Uri:
_api/web/lists/GetByTitle('Employee Birthday')/Fields/CreateFieldAsXml
  1. Headers:
{
  "Accept": "application/json;odata=verbose",
  "Content-Type": "application/json;odata=verbose"
}
  1. Body:
{
  "parameters": {
    "__metadata": {
      "type": "SP.XmlSchemaFieldCreationInformation"
    },
    "SchemaXml": "<Field Type='Thumbnail' DisplayName='Employee Photo' Name='EmployeePhoto' StaticName='EmployeePhoto' />",
    "Options": 0
  }
}
HTTP POST request to add Image to SharePoint List in Power Automate

After configuring the action, save the flow, then click Test.

Then run the flow manually.

Once the flow runs successfully, go to the Employee Birthday SharePoint list and open List Settings.

Under the Columns section, you can see the newly created Image column named: Employee Photo

How to Create an Image Column in SharePoint List Using Power Automate REST API

Now users can upload images directly into the SharePoint list item form.

Conclusion

This is how we can create an Image column in a SharePoint Online list using the Power Automate REST API.

In this tutorial, we used the Send an HTTP request to SharePoint action along with the CreateFieldAsXml REST API endpoint to dynamically create the Image column.

You may also like:

Power Apps functions free pdf

30 Power Apps Functions

This free guide walks you through the 30 most-used Power Apps functions with real business examples, exact syntax, and results you can see.

Download User registration canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App