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 / Applying filter to For...
Power Automate
Unanswered

Applying filter to For each flow

(0) ShareShare
ReportReport
Posted on by 2,249

Here is my flow

 

1)when a file is created(properties only)

2)Get files (properties only)

3) For each

    i)get file content // identifier from get files(properties only)

    ii)Compose //name from get files(properties only)

iii)create file //In destination document library

 

 

I am able to copy documents from source document library to target document library but im unaware how to filter specific files from source document library as per above flow steps

 

Source document library

Title

Location.txt

Locations001.txt

supply.txt

 

Expected Output :

Target document library

Title

Location.txt

Locations001.txt

 

 

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

    Hi @Veblitz ,

     

    I recommend you use filter array to get expected files.

    Take your assumption as an example, I just want to get:

    Location.txt

    Locations001.txt

    vmengmlimsft_0-1708959224437.png

     

     

    Best regards,

    Rimmon

  • Veblitz Profile Picture
    2,249 on at

    Thanks for your help.

     

    should we need to add the filter array step inside for loop and remove compose step as per below steps:

     

    1)when a file is created(properties only)

    2)Get files (properties only)

    3) For each

        i)get file content // identifier from get files(properties only)

        ii)Compose //name from get files(properties only) ? do we need to remove this and add filter array as you shared ?

    iii)create file //In destination document library

  • Veblitz Profile Picture
    2,249 on at

    Flow is getting failed.No dependents actions succeded

  • v-mengmli-msft Profile Picture
    on at

    Hi @Veblitz ,

     

    Do you want to create files according to filtered out files?

    If so, you should use body of Filter array in apply to each and use expression to get file identifier.

    vmengmlimsft_0-1708962775849.png

     

    In addition, could you please show some screenshots about your failed steps?

     

     

    Best regards,

    Rimmon

     

  • Veblitz Profile Picture
    2,249 on at

    Further im getting below error after updating your recent inputs.

    Error details:

    From property value in the query action inputs is of type object .The value must be an array.

  • Veblitz Profile Picture
    2,249 on at

    im getting error in filter array steps.

  • v-mengmli-msft Profile Picture
    on at

    Hi @Veblitz ,

     

    Are you using same dynamic content as my screenshot?

    If no, what is the value in the From field of Filter array?

     

    Best regards,

    Rimmon

  • Veblitz Profile Picture
    2,249 on at

    I tried using your screenshot for dynamic content in filter array

    outputs('Get_files_(properties_only)')?['body/value']

     

    Also ,now im using below one in my flow for filter array

    outputs('Get_files_(properties_only)')

  • v-mengmli-msft Profile Picture
    on at

    Hi @Veblitz ,

     

    'outputs('Get_files_(properties_only)')' returns an object. This is why filter array shows 'From property value in the query action inputs is of type object .The value must be an array'.

     

    You should keep the previous dynamic content.

    outputs('Get_files_(properties_only)')?['body/value']

     

    Did the below error appear when you use same dynamic content as my? If so, could you please show some screenshots about it and details of actions?

    vmengmlimsft_0-1709014380378.png

     

    Best regards,

    Rimmon

  • Veblitz Profile Picture
    2,249 on at

    Hi,

     

    I am not getting same error also i used same dynamic content as you share,still not working

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard