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 / HTTP Post / GET on Sha...
Power Automate
Answered

HTTP Post / GET on SharePoint Image Column

(0) ShareShare
ReportReport
Posted on by 11,128 Moderator
Another user originally posted this here, however I think it is better suited to be here in general discussion. 

 
Below is the original return of an HTTP Post / Get on an image column image created sometime prior to date of change last week
{
  "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\"}"
  }
}
 
And now they are returning this
{
  "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\"}"
  }
}


If it is run on an image that was added BEFORE whatever date this happened, it runs fine.

SO it appears this is an issue of when the image is added to the image column only the filename is being recorded, none of the other data, serverURL etc is generated now.

 
 
 


 
Categories:
I have the same question (0)
  • Suggested answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
  • TheRobRush Profile Picture
    11,128 Moderator on at
    Thanks for the suggestion, but that is not the solution in this instance. The current setup works fine on anything created before sometime in past 3 days. Sometime during that time span Microsoft made a change, and images added to an image column no longer include any data that they used to other than filename. Put in a bug report and waiting to see if they did it intentionally or if it was a mistake
  • TheRobRush Profile Picture
    11,128 Moderator on at
    _api/Web/Lists/getByTitle('Requests')/items?$filter=ID eq @{triggerBody()['number']} &$select=Logo1
     
    Above is Uri of my request, has worked up until sometime after Monday. AND still works on any image that was created before whenever this change was made. Just not on images added to image columns since Logo1 is the image column name
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at
     
    Ok so I got a solution working that addresses my needs.

    I could not simply pivot to taking the file info by using get attachments ALONE as there are multiple Image Columns to allow team to design the body of an email the way they want it to be, via powerapps, and then have it sent out like this via flow.

    So solution needed to be able to see how many images were chosen, then differentiate between them (even though they have for whatever reason now been all dumped into the attachment storage together and discarded their serverUrls in the image column itself)

    From powerapps I passed the id number of the record, and the number of images used (using this method passing number of images not necessary, but since my old one did it might as well keep it since its one less expression to write later.)



    After this I initialize several variables
     
    • warpFactor
    • warpFactor2
    • imgDynamicWidth
    • imgDynamicWidth2
    • firstLogo
    • secondLogo
    • firstLogoHtml
    • secondLogoHtml
    First 4 variables just control image size, making it variable so team does not have to worry about the image size they use, but will via html adjust the end image so everything fits the format when sent

    firstLogo on is what we will use to grab the information needed to send out the emails (while maintaining the images ability to be displayed in external email boxes not only internal to company)
     
    After setting up our variables I run a get attachements on the get item we collected
     
     
    followed by a Scope to gather all the steps to set the html for the images in a tidy package
     
     
     
    First two actions here are http posts, where ParkingRequests is your list name and Logo1 and Logo2 are your two image column names

     
    In the third action we set the html for the first image
     
    the condition expression is
     
    first(body('firstLogoHttp')?['d']?['results'])?['Logo1']
     
    is equal to
     
    null
     
     
    First action here is a Set Variable action where the expression for value is
     
    json(first(body('firstLogoHttp')?['d']?['results'])?['Logo1'])?['fileName']
     
     
    Second Action is a Filter Array
    From is equal to body('getLogos') //getLogos is name of my get attachments action//
    filter below is
     
    item()?['DisplayName']
    is equal to
    variables('firstLogo')
     
     
    The next action is a Get File Content using Path
     
    where file path =
      first(body('identifyFirstLogo'))?['AbsoluteUri']
     
     
    Next I use two Set Variables to set the size information for the image as it will be when embedded into the email

     
    expression for each is
     
    warpfactor =
    div(float(outputs('Get_item')?['body/imgHeight']), 80)
     
    imgDynamicWidth =
    div(float(outputs('Get_item')?['body/imgWidth']), variables('warpFactor'))
     
    imgHeight and imgWidth (also for secondImg etc as imgHeight2 imgWidth2 and so on) are number columns in the record that include the original height and width of img uploaded by the team.
     
    Last action is this

    here we check if the number of images added to the record (via the value passed from powerapps / could alternatively base this on the return of the secondLogoHttp action above) is equal to 1, and if so set the html line for an email with only 1 image, else we set it for 2

    the Value when it is 1 is
    <img src="data:body('firstLogoFilePath')['$content-type'];base64,body('firstLogoFilePath')['$content']" / height=80 width=variables('imgDynamicWidth') background-color=white>
     
    when it is 2 it is
    <img src="data:body('firstLogoFilePath')['$content-type'];base64,body('firstLogoFilePath')['$content']" / height=60 width=mul(div(variables('imgDynamicWidth'), 4), 2) background-color=white>

    You may ask, what if it is 0? I have an action early on in the flow that checks if its 0, and sends the no image version of email then terms the flow if so.
     
    next action in the scope is basically same as this previous one, only looking at all the second image info and at the end of it no check on image number is necessary since it firing off art all is dependent on there having been a second image, so you will always use the 2 image html format
     
     
    at the end simply drop these variables into your html email like so


     
    and thats the new easy way to get the image column info for embedding images in emails that will go to external clients

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard