Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

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

  • Community Power Platform Member Profile Picture
    on at
    Re: Condition not working

    Hi @Expiscornovus ,

     

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

  • Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: Condition not working

    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
    Re: Condition not working

    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. 😔

  • Verified answer
    Expiscornovus Profile Picture
    31,641 Most Valuable Professional on at
    Re: Condition not working

    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

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,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow