web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Copy Image column item...
Power Automate
Suggested Answer

Copy Image column items of sharepoint list to another sharepoint list

(2) ShareShare
ReportReport
Posted on by 71
Hi,
I have two SharePoint lists - List A and List B both with columns of type Image. I want to copy all the items from List A to List B. I am trying to use power automate (unless there is a simpler solution within SharePoint) and I am getting stuck with copying the image. 
 
The reason I am trying to do this is because we have list which has information for two locations and the data is pretty high. I want to have two separate lists for both locations and wanted to move the items of one location to a new list. This is the flow I have so far. Any help would be appreciated.
 
 
Categories:
I have the same question (0)
  • Suggested answer
    MT-09122050-0 Profile Picture
    8 on at
    I've been trying to do the same thing and I have finally figured it out. Here are the steps I took in my flow to get it to work.
    1. Send an HTTP request to SharePoint 1
      • Method: GET
      • URI: _api/lists/GetByTitle('<Name of your source List>')/items(<source item ID>)
    2. Parse JSON 1
      • Content: body('Send_an_HTTP_request_to_SharePoint_1')
      • Schema: <generate from sample of "Send an HTTP request to SharePoint 1" output>
    3. Parse JSON 2
      • Content: body('Parse_JSON_1')?['d']?['<image column name>']
      • Schema: {
            "type": "object",
            "properties": {
                "fileName": {
                    "type": "string"
                },
                "originalImageName": {
                    "type": "string"
                }
            }
        }
    4. ​​​​​​​​​​​​​​(Repeat step 3 for each image column)
    5. Send an HTTP request to SharePoint 2
      • Method: GET
      • URI: URI: _api/lists/GetByTitle('<Name of your destination List>')/items(<destination item ID>)
    6. Parse JSON 3
      • Content: body('Send_an_HTTP_request_to_SharePoint_2')
      • Schema: <generate from sample of "Send an HTTP request to SharePoint 2" output>
    7. Get attachments
      • List Name: <source List>
      • Id: <source Id>
    8. Apply to each: body('Get_attachments')
    9. Get attachment content
      • List Name: <source List>
      • Id: <source Id>
      • File Identifier: items('Apply_to_each')?['Id']
    10. Condition: items('Apply_to_each')?['AbsoluteUri'] contains <your image column name> | If yes:
      1. Add attachment
        • List Name: <destination List>
        • Id: <destination Id>
        • File Name: items('Apply_to_each')?['DisplayName']
        • File Content: body('Get_attachment_content')
      2. Send an HTTP request to SharePoint 3
        • Method: POST
        • URI: _api/web/lists/GetByTitle('<Name of your destination List>')/items(<destination item ID>)
        • Headers: {
          "Content-Type": "application/json;odata=verbose", "Accept": "application/json;odata=verbose",
          "X-HTTP-Method": "MERGE", "If-Match": "*"
          }
        • Body: {
              "__metadata": {
                  "type": "@{body('Parse_JSON_3')?['d']?['__metadata']?['type']}"
              },
              "<image column name>": "{
                  \"fileName\":\"@{body('Parse_JSON_2')?['fileName']}\",
                  \"originalImageName\":\"@{body('Parse_JSON_2')?['originalImageName']}\",
                  \"Url\":\"@{outputs('Add_attachment')?['body/AbsoluteUri']}\"
              }"
          }
      3. Delete attachment
        • List Name: <source List>
        • Id: <source Id>
        • File Identifier: items('Apply_to_each')?['Id']
      4. Send an HTTP request to SharePoint 4
        • Method: POST
        • Uri: _api/lists/GetByTitle('<Name of your source List>')/items(<source item ID>)/validateUpdateListItem
        • Body: {
              "formValues":[
              {
                  "FieldName": "<image column name>",
                  "FieldValue": ""
              }
              ]
          }
    11. (Repeat step 10 for each image column)
    ​​​​​​​

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard