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 Automate
Unanswered

Condition not working

(0) ShareShare
ReportReport
Posted on by

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,189 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
    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,189 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
    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

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard