cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Access file contents via a url in a list

I have a SharePoint List (List A) and one of the 'columns' contains a link (url) to a document in another list (List B).
I'm trying to construct a flow that does the following. The Flow is triggered when a value in List A is modified (e.g. a status is set to true). I'd like to access the contents of the file in List B, convert it to PDF and save the new file in List B.

There doesn't seem to be an obvious way to do a "Get" to obtain the ID of the file in List B (via it's url) from List A.
I've tried 'Get Attachment Contents' and the flow ran ok, but the output was blank, because (I presume) the Action wasn’t able to get a handle for the source file in List B.
Any ideas?

3 REPLIES 3
v-zhos-msft
Level 10

Re: Access file contents via a url in a list

Hi @Anonymous @

The Url of the document contain the name of the file.

First, we can get the name from the Url in List A, then using the ‘condition’ to get the document from List B.

 I have made a test on my side, please take a try with the following workaround:

The Url which I created in List A is like this: file:///C:/Users/zhongys/Desktop/Daily words.docx

The compose action is to get the Name of the document.

The expression is : last(split(triggerBody()?['Url'],'/'))

1.png2.png3.png

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Re: Access file contents via a url in a list

hI v-zhos-msft ,

Thanks for your reply, it is very much apprecaited. I spent some time experimenting with the teqnique you set out in your response but with no success. Unfortunately the url in the column in List A looks something like this...

"https://xxxxxxxx.sharepoint.com/:w:/s/itmgt/pmo-staxxxs/PT/ArchiHome/EXXvrSR3xfefsfsfe52nVJ7vG18BBEt..."

I'm therefor not able to split off the file name and then compare it to each item in the list to find the item in List B.

What confuses me is that the url is a unique 'path' to the file so why can't that be used to get the contents of the file?

Anonymous
Not applicable

Re: Access file contents via a url in a list

spent a bit more time on this... If I hard code the ID of the document the flow works perfectly. So, the missing bit is how to derive the ID of the document from the url

FLOW_EXAMPLE3.PNG

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 242 members 5,133 guests
Please welcome our newest community members: