web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Move file in SharePoin...
Power Automate
Answered

Move file in SharePoint to a folder based on the Modified By

(0) ShareShare
ReportReport
Posted on by 18

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

Categories:
I have the same question (0)
  • Verified answer
    v-mengmli-msft Profile Picture
    on at

    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".

    vmengmlimsft_3-1698725069510.png

     

     

    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']

     

     

    vmengmlimsft_4-1698725144770.png

     

     

    Thanks for reading!

    Rimmon

     

  • Zainab J Profile Picture
    18 on at

    Thanks Rimmon for the quick response and thorough explanation  

    I will give it a try and see if it works 

     

    Regards,

    Zainab

  • Zainab J Profile Picture
    18 on at

    Hi @v-mengmli-msft

     

    All the steps works fine but not the final "Move file". It throws an error 

     

    ZainabJ_0-1698920248536.png

    Appreciate the help 

     

  • v-mengmli-msft Profile Picture
    on at

    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

  • Zainab J Profile Picture
    18 on at

    Thanks @v-mengmli-msft 

    It turned out I chose the wrong identifier. It is working fine now

     

    Many thanks

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard