Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

File not found, when I know it's correct

(0) ShareShare
ReportReport
Posted on by 11
Hi, this is driving me crazy.
 
I have a flow that I am getting an image from a SharePoint Column,
the flow goes like this(all thru the outputs, I can see my file name and it is correct)
 
in Get File Content from a SharePoint list , I am using this:
encodeUriComponent(replace(body('Parse_Image_JSON')?['serverRelativeUrl'],/sites/'MYSITE_GOES_HERE',''))
 
I can see the file name in my output:
{"fileName":"275f876e-41f1-47fa-a2c8-31fc44ecc063.jpeg","serverRelativeUrl":"/sites/MYSITE/SiteAssets/Lists/d7ef4c88-6cd9-4738-b02b-2e4ea6c5885f/275f876e-41f1-47fa-a2c8-31fc44ecc063.jpeg","id":"4a084b5d-2ac8-4a43-9960-260e82f1e615","serverUrl":"https://mymainsite.sharepoint.com","thumbnailRenderer":null}
 
When I actually look at MYSITE/SiteAssets/Lists/d7ef4c88-6cd9-4738-b02b-2e4ea6c5885f/275f876e-41f1-47fa-a2c8-31fc44ecc063.jpeg  I can see the image and display it in the browser.
 
The only thing I can see is that the"serverUrl" is our main sharepoint and not my actual site....
 
I just don't know.
 
Help Please. Thanks!
Jim
 
  • Expiscornovus Profile Picture
    Expiscornovus 30,927 on at
    File not found, when I know it's correct
     
    You could also use another HTTP request. With that type of approach you don't have to replace and parse your values, because the serverRelativeUrl value is already in the correct format for the GetFileByServerRelativeUrl method with the $value property.
     
    Below is an example of that approach.
     
    In this setup the Image column name is Bild btw. You need to replace that by your column name.
     
    1. Get File Content HTTP request
    _api/web/GetFileByServerRelativeUrl('@{json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['Bild'])['serverRelativeUrl']}')/$value
    2. Json to create the file in OneDrive
    json(outputs('Send_an_HTTP_request_to_SharePoint')?['body']['Bild'])['fileName']
     
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,867

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,161

Leaderboard