Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

  • Zainab J Profile Picture
    18 on at
    Re: Move file in SharePoint to a folder based on the Modified By

    Thanks @v-mengmli-msft 

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

     

    Many thanks

  • v-mengmli-msft Profile Picture
    on at
    Re: Move file in SharePoint to a folder based on the Modified By

    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
    Re: Move file in SharePoint to a folder based on the Modified By

    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 

     

  • Zainab J Profile Picture
    18 on at
    Re: Move file in SharePoint to a folder based on the Modified By

    Thanks Rimmon for the quick response and thorough explanation  

    I will give it a try and see if it works 

     

    Regards,

    Zainab

  • Verified answer
    v-mengmli-msft Profile Picture
    on at
    Re: Move file in SharePoint to a folder based on the Modified By

    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

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,660 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow