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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Condition not working

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

 

Currently, I am trying to automate getting a file from the latest folder in Sharepoint Library. So far, I am able to get the Name and Path of the latest folder but it is the subsequent steps that I have trouble with.

 

1. Get files (properties only)

2a. Select operation --> outcome: gets latest folder in library. 

Map:

Name: item()?Name

Path:  item()?Path

b. initialise varArr with String values. 

3. Compose outcome. inputs: first(body('Select')?['Name']) 

as the first record is the latest folder

4. Filter array 

From varArr

item() is equals to outputs('Compose')

5. Condition 

length(body('Filter_array')) is equals to 1 // folder name should only match with one element in the arr

 

If anyone can spot my mistake, please do advise on what I should change. Thank you

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,773 Most Valuable Professional on at

    Hi @Anonymous,

     

    I think the closing parentheses of the first function is in the wrong location. Can you try this expression instead in the Compose?

    first(body('Select'))['Name']

     

    The rest looks alright. I tested with the below config in my dev environment.

     

    firstfunction.png

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Expiscornovus ,

     

    Thanks for your response. I have tried out what you have suggested and my condition output is still false. I have a feeling there might be something wrong with step 2. When the Filter array operation is executed, the output is an empty array. I am not too sure what is the issue with it. 😔

  • Expiscornovus Profile Picture
    33,773 Most Valuable Professional on at

    Hi @Anonymous,

     

    Can you double check or share screenshots of the outputs of the Select, Initialize variable and Compose actions of your flow run?

     

    The comparison would be case sensitive. Make sure there is not a different casing in values and they are exactly the same.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Expiscornovus ,

     

    I just spotted my mistake. Thank you so much for your help! 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 251 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 239

#3
Expiscornovus Profile Picture

Expiscornovus 220 Most Valuable Professional

Last 30 days Overall leaderboard