Hello,
I'm trying to create a flow that move files from one SharePoint to another based on the Modified By column. I need the flow take the modifier name and loop through the existing folders, if there is a folder that matches the modifier's name; move the file to that folder. If not, create a folder for the new modifier's name and move the file to there.
I created a condition that specify the known users whom usually create those files (Check attached image), but I want the flow to loop through the names and folder instead of specifically given names
Thank you in advance
Thanks @v-mengmli-msft
It turned out I chose the wrong identifier. It is working fine now
Many thanks
Hi @ZainabJ ,
The error shows the destination is a pdf file not a folder.
Please check the destination in the move file, it should be a folder path which is used to save files.
Best regards,
Rimmon
Hi @v-mengmli-msft,
All the steps works fine but not the final "Move file". It throws an error
Appreciate the help
Thanks Rimmon for the quick response and thorough explanation
I will give it a try and see if it works
Regards,
Zainab
Hi @ZainabJ ,
Please try this:
Overview:
test1 folder stores multiple folders named with person name.
test2 folder stores files created by user.
1.get new file properties in test2 folder.
2.list folders in test1.
3.filter folders in test1 which has same name with "Modified By DisplayName" dynamic content about "when a file is created".
The details in Condition:
1.Determine whether the filter result in the above steps is empty, if it is empty, create a new folder.
2.Compose: get the folder path which is used to store the new file with same person name.
Expression in Condition:
empty(body('Filter_array'))
Expression in Compose:
outputs('Filter_array')?['body'][0]['Path']
Thanks for reading!
Rimmon
WarrenBelz
146,660
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional