Image Column - Get Items-Loop - Copy Images from sub-list
AnsweredGreetings,
Within a QAQC solution I have 3 lists at play...
1. Site Inspections [Parent]
1a. Inspections [Child]
2. Issue Tracker
---
Site Inspections allows for multiple Inspections to be completed. Once a Site Inspection is set to 'Submitted', I have actions which get all 'Inspections' of that 'Site Inspection' which are 'Non-Conforming', and they are added to the Issue Tracker list.
Image Columns are the only type that are giving me an issue here. I have tried a dozen potential ways of achieving this, and the only method with any success is the most simple:
=[[@Actions.Loop_apply_to_each.CurrentItem]].Photo
With 'Photo' being the name of the image column.
Console Log doesn't through any errors, object-object, nulls, etc... and it seems like it moves the image in a broken way.
In the Issue Tracker list, the Image appears as such on the DispForm. [Note: Clicking that icon opens the original picture, but it is like the top-left 1/4 of the original picture]
And in the ListView of Issue Tracker it appears as such: [Note: clicking the image here takes you to an invalidRequest type of page.]
--- --- ---
What would be the proper way to add/copy an Image Column in this situation?
Thanks,
Taylor
-
This no longer seems to work:
'{"type":"thumbnail","fileName":"[[Photo.FileName]]","serverRelativeUrl":"[[Photo.URL]]"}'
Any thoughts?
Thanks,
Taylor
0 -
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 -
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.
Comments
3 comments