Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Automatically move to Folder/Condition

(0) ShareShare
ReportReport
Posted on by

Hello,

 

im currently trying to sort documents of a library into subfolders using a field with a Date, the sub folders should then be : year/month/document

 

I found a similiar request and got it to work (kinda)

https://powerusers.microsoft.com/t5/Building-Flows/Sharepoint-move-files-and-create-a-folder-based-on-month/td-p/99881

 

The Problem is I have Documents that do not have a Date or other informations assigned yet and only want files to be moved if all fields are set, so I tried building a condition that checks if the fields are null, this also seems to work.

 

BUT as soon as I run the flow with at least one Document that has all fields set the flow will copy all files even if all fields are blank but the Date is set.

 

It seems like the apply to each uses all files previously saved and if one of them gets through the condition all of them get proccessed like they also got a true in the condition.

 

I tried to set the condition after the get files properties but it always creates a new "Apply to each"

 

 
 

image.pngimage.pngimage.png

 

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: Automatically move to Folder/Condition

    Hi @Landline,

     

    If these items are string format, you could use the length() function to get length of the value, then judge them whether is not equals to 0:Annotation 2020-04-10 152729.png

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • JohnAageAnderse Profile Picture
    1,986 on at
    Re: Automatically move to Folder/Condition

    Hello @Landline 

    In your condition, under the If Yes branch, you do not need the Apply to each action as at that point you are working with a single document!

    Kind regards, John

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1