Hi Team,
Is there a way to design power automation where I want a column of list to be filled if the things are added in the document library?
Eg- I have a document library and If I add the folder to that library with the files in it then I would like that to add to my SharePoint list and I want the folder name to be in one column and the file name inside the folder to be in another column. and I need the file to be also attached with the list either a link to a file or file.
Folder name in 'Unit' column
Files name in 'Case ID' Column
Another column for attachment.
Hi Wearsky,
Thank you so much for your response and that worked.
Could you please also help me with the below query?
Kind regards,
V
Hi @Anonymous ,
Hope you are doing well.
We can create a string variable to collect all file extensions.
Then please use this expression
if(contains(variables('var'),split(slice(triggerOutputs()?['body/{FullPath}'],add(lastIndexOf(triggerOutputs()?['body/{FullPath}'],'/'),1)),'.')?[add(length(split(slice(triggerOutputs()?['body/{FullPath}'],add(lastIndexOf(triggerOutputs()?['body/{FullPath}'],'/'),1)),'.')),-1)]),triggerOutputs()?['body/{Name}'],triggerOutputs()?['body/{FilenameWithExtension}'])
instead of
split(slice(triggerOutputs()?['body/{FullPath}'],add(lastIndexOf(triggerOutputs()?['body/{FullPath}'],'/'),1)),'.')?[0]
Best Regards,
Wearsky
Hello @Anonymous ,
do you want to grab the file url for each copied file?
If yes, my solution should work, regardless the trigger.
If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.
My blog site about Power Automate: https://powerautomatejoy.com/
BR,
Marco
Hi Macro,
1st step says when a file is created but I'm not using it. I have a document library and I'm copying folder in it with the files and then it take the folder name as path and file name and fill the column of the list.
I have this flow which worked halfly,
The problem with that is that I have a file name with test.in.1.docx and the flow is deleting all the character after '.' but I want the flow to only delete the file extension name which is docx.
Sure @Anonymous ,
you can Update the item by adding the "AbsoluteUri" value, got from the "Add attachment" action, in another column:
If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.
BR,
Marco
Hi Macro,
Can I please have something that can copy the link of the file and paste it in another columns.
Kind regards,
V
Hello @Anonymous ,
please follow these steps:
1. Trigger=When a file is created in a folder:
Please select the SP site and the Folder
2. Add a SP "Get file content" action:
Select the SP site and add the "x-ms-file-id" value got from the Trigger
3. Add a "Create item" action:
Select the SP site, the List and fill the Case ID and the Unit in the following way:
4. Then, use the "Add attachment" action:
Select:
- ID=the Item ID grabbed from the "Create item" action;
- File Name=the Name grabbed from the Trigger;
- File content= the content grabbed from the "Get file content" action.
If I have answered your question, please mark my post as Solved.
If you like my response, please give it a Thumbs Up.
BR,
Marco
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2