Hello,
I am trying to create a Power Automate flow to retrieve an image from Sharepoint and embed the image in an email:
The Parse JSON 2 shows the location of the image but my flow continues to fail on the Get File Content step with 'File not Found:'
{
"type": "thumbnail",
"fileName": "b0d1d2a7-2dcb-49bb-8bc4-a27854194e6e.jpeg",
"fieldName": "DeskLocation",
"serverUrl": "https://pathward.sharepoint.com",
"serverRelativeUrl": "/sites/companyname/SiteAssets/Lists/031fd855-ab73-4f5c-8220-8c7bffe4e559/b0d1d2a7-2dcb-49bb-8bc4-a27854194e6e.jpeg",
"id": "a54d2df7-9423-4bdc-968e-6e9e8e6ca20f"
}
I've also tried to Get File Using Path but no luck there either. Here is an image of the folder location:
I attempted to create an encodeUriComponent but still a no go: encodeUriComponent(replace(body('Parse_JSON_2')?['serverRelativeUrl'],'/sites/companyname/SiteAssets/Lists/031fd855-ab73-4f5c-8220-8c7bffe4e559/',''))
Can someone please take a look to see why Power Automate is not finding the '031fd855-ab73-4f5c-8220-8c7bffe4e559' reference folder?
Thanks
I am not sure if it is that or something else, but the error message would seem to indicate that it is. I would check your permissions on the site where you are pulling in the image from. Maybe you only have view access, which would prevent downloading the file.
Thanks David. I was able to Get File Content using Path to work. Now I'm receiving error message:
Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
clientRequestId: 03dde239-8ac9-44db-89bf-864f47ea6bc5
serviceRequestId: 03dde239-8ac9-44db-89bf-864f47ea6bc5
Is this a Permissions issue?
I would try it by using Get file content using path. You can then use a compose action to generate the html expression for using a base64 image. Note, be sure to specify the correct image type in the string
The expression in the above action is, is inserted after the comma and before the quote:
base64(outputs('Get_file_content_using_path')?['body'])
Then put your e-mail message in HTML mode and put the output of the compose action where you want the image inserted. You can also just put the above in the e-mail where the image needs to go as well.
As a reference: How to Display Base64 Images in HTML (w3docs.com)
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional