Bulk update Image column of SharePoint list – using Power Automate – Part 1

Hello everyone and welcome to my blog. In today’s blog I will discuss about a very interesting topic related to Image column type in SharePoint List.

Sometime back, Microsoft introduced Image column type for SharePoint list. It is indeed a great feature as prior to that if you have a list of products and you want to product image or a profile image for a student list, the only way out was to create an attachment for the each record.

There is however a small issue with Image column types. And the issue is with bulk edit of Image column.

In this blog I will go ahead and explain on how to clear an image column type for multiple records at a time. In the next blog, I will demonstrate on how to bulk update an image column with a specific image.

So let’s get started with an example. Below is a SharePoint list which have an image column – “Report Thumbnail”. My requirement is to clear out the Report Thumbnail column for all the four items of the list. If I speak in technical terms, it’s basically updating the Report Thumbnail column to null.

Bulk update SharePoint List Image column using Power Automate

Let’s go the usual way of edit in SharePoint. Select the records from grid and then click on Edit. Unfortunately in bulk edit screen, the image column does not show up.

Bulk update SharePoint List Image column using Power Automate

This is OK if you have few records. But if you want to update the column value to empty for many records at a time, this may soon become annoying. So let’s see how we can automate this whole process.

You can choose any automation technique but the basics will always remain the same. However for this demo, I will choose Power Automate to update the image column value to blank for multiple records.

Let’s start designing the Power Automate flow. I choose an instant cloud flow with Manual trigger. The first step is to retrieve all the records for the Report List. To do this, use the Get Items action of the SharePoint connector. You can apply filters on this connector to fetch only the items you want to update.

Bulk update SharePoint List Image column using Power Automate

The next step is to iterate through all the list items fetched in the previous step and update the Report Thumbnail to column to null.

And here in comes the twist. The image column is a special data type and can’t be updated like regular columns. If you are thinking that setting it to null expression will set the column value to empty, it’s not going to work. In-fact you will get an error.

So let’s see how we can clear out the column value.

Within the Apply to each, I use the Compose action. I set the Inputs property of the compose action to the JSON as in the below screenshot.

Bulk update SharePoint List Image column using Power Automate

The final step is to perform update in SharePoint. For that I used the ‘Send an HTTP request to SharePoint‘ connector with the following configuration.

Bulk update SharePoint List Image column using Power Automate

As you can see in the above screenshot, I update each list item record. I am invoking the ValidateUpdateListItem endpoint to update the field. This is because the Image data is not directly stored in the SharePoint List item.

The body property, I set it to the following JSON

{
   "formValues": [
      {
         'FieldName': 'ReportThumbnail',
         'FieldValue': '@{outputs('Compose')}'
      }
   ]
}

The field name is the name of the image column. Make sure you use the internal column name and not the display name of the column. To find the internal name of the column, navigate to list settings and edit the column. You can get the internal name in the URL.

Bulk update SharePoint List Image column using Power Automate

For the Field Value, we use the output of the Compose action from previous step.

Well that’s it. It’s now time to execute the flow. The flow runs successfully and quite expectedly, the Report Thumbnail column for all the records have been updated to null.

Bulk update SharePoint List Image column using Power Automate

Wonderful isn’t it? In my next blog, we will walk through on how to bulk update the image column to a specific image instead of setting it to null.

I have used Power Automate here. But if you are using any other ways to update, you would still need to call the invoke the same endpoint and pass the request body in similar JSON format.

If you liked the post and this post has helped you, you can buy me a coffee. Links on the right side pane.

You will also like the below posts.

Debajit Dutta
Business Solutions MVP


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

4 thoughts on “Bulk update Image column of SharePoint list – using Power Automate – Part 1”

  1. Hi there

    Can you please advise when the next blog post will appear? I been searching everywhere and every post I find talks about the hyperlink/picture column type and not image type.

    Cheers

    1. Debajit Dutta (Business Solutions MVP)

      Hi Daniel, It’s in process and will hopefully be done over the weekend. thanks for reading.

      -Debajit Dutta

  2. Pingback: Bulk update Image column of SharePoint to a specific Image - Debajit's Power Apps & Dynamics 365 Blog

Comments are closed.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading