Skip to main content

Search

Image Column - Get Items-Loop - Copy Images from sub-list

Answered

Comments

3 comments

  • Kilgore ServiceAccount

    This no longer seems to work:

    '{"type":"thumbnail","fileName":"[[Photo.FileName]]","serverRelativeUrl":"[[Photo.URL]]"}'

    Any thoughts?

    Thanks,

    Taylor

     

     

    0
  • Kilgore ServiceAccount

    Something I noticed in Power Automate recently...

    In older runs, for an HTTP request to get an Image, it would return:

    {
     "d": {
       "__metadata": {
         "id": "7c424089-eaab-4da4-ab2b-e20ca317fb6e",
         "uri": "https://[DOMAIN].sharepoint.com/sites/[SITE]/_api/Web/Lists(guid'c410efef-46a6-456e-a798-ca77b24c9661')/Items(1323)",
         "etag": "\"2\"",
         "type": "SP.Data.Inspectie_x0020_Resultaten_x0020_PicsListItem"
       },
       "[IMAGE]": "{\"type\":\"thumbnail\",\"fileName\":\"2c4aab55-4cea-4fcf-aef5-860c461b9ef3.jpeg\",\"fieldName\":\"[IMAGE]\",\"serverUrl\":\"https://[DOMAIN].sharepoint.com\",\"serverRelativeUrl\":\"/sites/[SITE]/SiteAssets/Lists/c410efef-46a6-456e-a798-ca77b24c9661/2c4aab55-4cea-4fcf-aef5-860c461b9ef3.jpeg\",\"id\":\"3430c542-ab3f-4bb3-8602-966faa627560\"}"
     }
    }

     

    Yet, if you were to try today, you'd see:

    {
     "d": {
       "__metadata": {
         "id": "3eba2611-0440-4e4a-801e-229d5b46f908",
         "uri": "https://[DOMAIN].sharepoint.com/sites/[SITE]/_api/Web/Lists(guid'c410efef-46a6-456e-a798-ca77b24c9661')/Items(1422)",
         "etag": "\"3\"",
         "type": "SP.Data.Inspectie_x0020_Resultaten_x0020_PicsListItem"
       },
       "[IMAGE]": "{\"fileName\":\"Reserved_ImageAttachment_[10]_[Afbeelding][36]_[9b918b28-a96b-4a31-aeef-9b7d08869f4a][1]_[1].jpeg\"}"
     }
    }

     

    The difference is in bold.

    0
  • Matthias_Walter

    Dear Kilgore ServiceAccount,

    the difference is, if you set the image whether using an out-of-the-box form or a skybow form. The out-of-the-box form will save the image in the attachments, where it only needs a filename whereas we store the image in the site assets, then you will get more properties. So first of all make sure to use a skybow form to set the image.

    If you have the images set by a skybow form, you can do the following to set them in a loop:

    You have to parse the image that is returned to a JSON object, that you can set it as described in our article with the correct string, which is a stringifyed JSON just having the serverRelativeUrl and the fileName:

    =JSON.stringify({ serverRelativeUrl: [[@Actions.Execute_script.ReturnValue]].serverRelativeUrl, fileName: [[@Actions.Execute_script.ReturnValue]].fileName })

    Kind regards

    Matthias

    1

Please sign in to leave a comment.