Easiest Way to Get Picture From SharePoint Image Column Using Power Automate

While working on an Employee Survey Application, I encountered an interesting challenge. After employees submitted their surveys, I wanted to generate a PDF that included a company logo. The logo was stored in an image column of another SharePoint list.

At first, this seemed straightforward, but when I tried to retrieve the image using Power Automate, I couldn’t figure out the actual address where the image was stored.

After some research and trial-and-error, I discovered the solution: using an HTTP request with SharePoint’s REST API to access the image column. If you’ve faced a similar issue, don’t worry! In this tutorial, I will guide you on how to get picture from SharePoint image column using Power Automate.

Get Picture From SharePoint Image Column Using Power Automate

Suppose your organization has a SharePoint list named Employee Directory, which includes the following columns:

  • Employee Name = Single line of text
  • Job Title = Single line of text
  • Profile Picture = Image column
Get Image Column in SharePoint List using Power Automate

I want to send a weekly email to managers that lists their team members’ names, job titles, and profile pictures.

To do this, follow the below steps:

1. Log in to Microsoft Power Automate, create an Instant Cloud Flow, enter a name for the flow, select the trigger “Manually Trigger a Flow,” and click Create.

send a sharepoint image column picture in an email using power automate

2. Add an Initialize variable action to store the item ID. Provide a name for the variable, set the type to Integer, and leave the value blank.

Get Image Column in SharePoint List in Power Automate

3. Add a Get items action to retrieve the employee information. Provide the Site Address and select the List Name.

Power Automate Get Image Column in SharePoint List

4. Add a Set variable action, select the variable name from the dropdown, and in the Value field, provide the ID from the dynamic content of the Get items action.

It will automatically add a for each loop.

Power Automa Get Image Column in SharePoint List

5. Then add a Send an HTTP request to SharePoint action from sharePoint Connector with the below parameter:

  • Site Address: Select the SharePoint Site Address
  • Method: Select “GET” as the method
  • URI: Provide the below URI:
_api/lists/getbytitle('List Display Name')/items(Item ID)/<Image Column Name>

This action sends an API request to SharePoint to retrieve data, specifically the value of the Profile Picture column in a list item.

how to get image from sharepoint in power automate

Save the flow, then click Test to run it. After the test is complete, go to the Outputs section of the Send an HTTP Request to SharePoint action. Copy the Body content from the outputs; this will be used later to define the JSON schema for parsing.

get image from sharepoint in power automate

6. Add Parse JSON action from the Data Operation connector. Then, in the Content field of the Parse JSON action, select the Body of the Send an HTTP Request to SharePoint action from Dynamic Content.

Click Use sample payload to generate schema for the JSON data. Paste the copied Body content into the Generate from sample window and click Done. The generated schema will look something like this:

add image to sharepoint list power automate

7. Add a Compose action after the Parse JSON action. In the Inputs field of the Compose action, select the Profile Picture element from the parsed JSON content (this will be available as Dynamic Content after parsing).

Get image file in Sharepoint list (not an attachment) Power Automate

Run the flow, and once it’s completed, expand the Compose action results in the Run History. Copy the output content from the Compose action.

Get SharePoint List Image in Power Automate

8. Add a new Parse JSON action after the Compose action. For the Content input, select the Profile Picture element from the dynamic content of the previous Parse JSON action (similar to the Compose action in Step 7).

Click GUse sample payload to generate schema. Paste the output data copied from the Compose action into the Generate from sample window. Click Done to generate the schema. The schema should look something like this:

Get Picture From SharePoint Image Column Using Power Automate

From the Parse JSON action above, I get the file name but can’t find the path to retrieve the image. We need to get the address like this:

https://your-tenant-name.sharepoint.com/sites/your-site-name/Lists/your-list-name/Attachments/your-Item-ID/Name of the flle

In my case:

https://szg52.sharepoint.com/sites/PowerAutomateTutorial/Lists/EmployeeDirectory/Attachments/10/Reserved_ImageAttachment_[14]_[ProfilePicture][14]_[Lidia Holloway][1]_[1].jpg

To get the image, I want to add the Get file content using path action. However, The Site Address is already known, but the File Path needs to be generated dynamically. The File Path format is:

/Lists/EmployeeDirectory/[File Name]

Where the File Name is something like:

Reserved_ImageAttachment_[14]_[ProfilePicture][14]_[Lidia Holloway][1]_[1].jpg

I have everything except the List Path(/Lists/EmployeeDirectory). So, go to Step 2, add an Initialize variable action, provide the variable’s name ( ListPath), and set the type to String. Leave the value blank for now. This variable will be used to store the list path.

How to get contents of an image column of SharePoint in Power Automate

In the 4th step, inside the For each loop, add a Set variable action. Select the variable name from the dropdown, and in the Value section, provide the below expression:

item()?['{Path}']
Power Automate HTTP get request to get Image to SharePoint List

9. After the second Parse JSON action, add the Get file content using path action. Provide the Site Address, and in the File Path field, use the following expression:

concat('/',variables('ListPath'),'Attachments/',variables('varID'),'/',body('Parse_JSON_1')?['fileName']

Where:

  • ‘/’ – This just starts the path with a slash (it represents the beginning of the SharePoint path).
  • variables(‘ListPath’) – This part gets the path of the SharePoint list, which we stored in a variable earlier (/Lists/EmployeeDirectory).
  • ‘Attachments/’ – This is the folder in the list where the files (attachments) are stored.
  • variables(‘varID’) – This gets the Item ID of the list entry (like 10), which helps identify the specific item.
  • ‘/’ – Another slash to separate the Item ID from the file name.
  • body(‘Parse_JSON_1’)?[‘fileName’] – This part grabs the file name from the previous action where you parsed the data (Reserved_ImageAttachment_[14]_[ProfilePicture][14]_[Lidia Holloway][1]_[1].jpg).
Downloading Photos from Image columns ins SharePoint using Power Automate

10. Add a Send an email action and provide the following parameters:

  • To: Provide the manager’s email address.
  • Subject: Provide a subject for the email.
  • Body: Provide the email content.
Get Image Column from SharePoint List in Power Automate

Run the Flow to get image from SharePoint image column using Power Automate

Save the flow and run it by selecting the Run Flow option. After the flow runs successfully, the manager gets the email.

How to Get Image Column in SharePoint List using Power Automate

Conclusion

This tutorial taught us how to use Power Automate to get an image from a SharePoint list. Using an HTTP request, we retrieved employee data, including profile pictures stored in an image column. Then, we parsed the response to get the file name, built the file path dynamically, fetched the image using the file path, and sent it in an email to the manager.

You may also like:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

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

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…