How to save SharePoint List images in multiple columns to SharePoint Folder.

Colin W Otto 0 Reputation points
2025-03-29T15:16:18.5+00:00

I have a SharePoint list, and each item in the list has multiple image columns. Each item is generated from a form, where an image is saved to a specific image column. There are multiple columns, each potentially with 0 or 1 image. I want to save each individual image to a SharePoint folder using power automate. How do I test whether there is an image in a column and if there is, save the image as a file?

SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
661 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ling Zhou_MSFT 23,605 Reputation points Microsoft External Staff
    2025-03-31T10:11:46.3366667+00:00

    Hi @Colin W Otto,

    Thanks for reaching out to us. We are very pleased to support you.

    My site name: 25Apr

    My list name: List2

    My image column name: picture1

    I will use the example of saving the image in picture1. In the example I will use <> to indicate where you need to replace your site name, your list name and image column name.

    Step 1: Add action "When an item is created" to trigger your flow.

    Step 2: Add action "Get item" to get the new created item.

    Step 3: Add action "Initialize variable" to save image file extension.

    User's image

    Step4: Add action "Scope" to start getting the image in the picture1 column.

    User's image

    Step5: Add action "Send an HTTP request to SharePoint".

    Uri:

    /_api/lists/getbytitle('<your list name>')/items(@{triggerOutputs()?['body/ID']})/<your column name>
    For example:
    /_api/lists/getbytitle('List2')/items(@{triggerOutputs()?['body/ID']})/picture1
    

    User's image

    Step5: Add action "Condition" to determine if the column has an image.

    body('Send_an_HTTP_request_to_SharePoint')?['d']?['<your column name>'] is not equal to null
    
    For example:
    body('Send_an_HTTP_request_to_SharePoint')?['d']?['picture1'] is not equal to null
    

    User's image

    Step6: Under "If yes" add action "Parse JSON".

    Content:

    body('Send_an_HTTP_request_to_SharePoint')?['d']?['<your column name>'] 
    
    For example:
    
    body('Send_an_HTTP_request_to_SharePoint')?['d']?['picture1']
    

    Schema:

    {
        "type": "object",
        "properties": {
            "fileName": {
                "type": "string"
            },
            "originalImageName": {
                "type": "string"
            }
        }
    }
    

    User's image

    Step7: Get file content

    File Identifier:

    encodeUriComponent(concat('/',body('Get_item')?['{Path}'],'Attachments/',body('Get_item')?['ID'],'/',body('Parse_JSON')?['fileName']))
    
    

    User's image

    Step8: Add action "Set variable" to save file extension.

    Value:

    last(split(body('Parse_JSON')?['fileName'],'.'))
    

    User's image

    Step9: Add action "Create file":

    Select the folder you want to save the image.

    FileName:

    concat(body('Parse_JSON')?['originalImageName'],'.',variables('Extension'))
    
    Note: Here I chose the name of the uploaded image as the name of the image saved to the folder, you can customize your image naming style here but be sure to add the file extension of the image.
    

    File Content:

    Get file content 's file content.

    User's image

    Perform the same steps for your other columns (Step4 - Step9).


    If you have any questions, please do not hesitate to contact me.

    Moreover, if the issue can be fixed successfully, please click “Accept Answer” so that we can better archive the case and the other community members who are suffering the same issue can benefit from it.

    Your kind contribution is much appreciated.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.