Hello, I'm attempting to build a Power Automate Flow that can grab the filename from each row and put them into a CSV file with two columns:
id | filename |
1 | first.pdf |
2 | second.pdf |
3 | third.pdf |
that way, I can pre-append my SharePoint's site URL to each id and image to return a link that we be later used in Power BI. However, I am running into some limitations of Power Automate that I do not know how to get around.
Currently, I have a flow that will get me all of my items and put them into a CSV file but I only have the option to see if there are attachments, not get the file name at all:
I tried to setup a different flow to get the attachments but that doesn't seem to work for me as I cannot select the ID with Dynamic Content:
I'm not sure where to go at this point. Any help is appreciated.
@Nived_Nambiar - hey, thanks a lot. I tested this and this looks good and returned a csv file for me. However, one issue I just ran into is that it's taking a long time to complete. I have about ~2000 items in the SharePoint list and when I turned on Pagination with 5000 limit threshold, it was around 17 minutes before I cancelled it as that is already too long with ~2000 items.
Do you know why it is taking so long or if it's possible to speed this up at all? In the first test, it took 48 seconds to get 100 records built which about 2 seconds per record. With ~2000 records X 2 seconds I am looking at ~66 minutes for this to finish.
EDIT: I think I can work around this and just order in descending order to get the newest 100 records and do some joining/refinements with Python.
Try this approach
1. use get items to get all items from SharePoint list
2. use initialize variable to initialize an array
3. use apply to each to loop through value dynamic content of get items action
3.1 - use get attachments under apply to each loop to get list of attachments associated with the list item
3.2- use append to array variable to append ID and filename information as an object to array variable created at step 2.
Expression:- first(outputs('Get_attachments')?['body'])?['DisplayName']
Outside the loop do the below steps
4. use create csv table to create csv table out of the array variable
This is how you can create csv table out of sharepoint list with details like ID and filename
Results of the flow
Hope this helps !
Nived N 🚀
LinkedIn: Nived N's LinkedIn
YouTube: Nived N's YouTube Channel
🔍 Found my answer helpful? Please consider marking it as the solution!
Your appreciation keeps me motivated. Thank you! 🙌
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492