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 Platform Community / Forums / Power Automate / Apply to each results ...
Power Automate
Unanswered

Apply to each results from condition

(0) ShareShare
ReportReport
Posted on by 19

Is there a way to count the amount of true/false results from a condition within an apply to each action?

Currently I only have a formula set to count the total items but I would like to be able to count how many resulted in true and how many resulted in false.

Categories:
I have the same question (0)
  • creativeopinion Profile Picture
    10,508 Moderator on at

    You should use a Filter Array action instead if you are looking to count the number of true and false items. Can you upload a screenshot of how your flow currently looks?

  • JoseC12 Profile Picture
    390 on at

    Hi @esang,

    You can employ the 'Increment variable' action. Let me provide an example:

    Initially, initialize two variables to determine whether each item is true or false.

    JoseC12_1-1692057998336.png

    Upon retrieving the items, such as checking whether an item is Active (1) or not, you can increment the 'countTrue' variable by 1 if it is true. Otherwise, if it's not active, increment the 'countFalse' variable by 1.

    JoseC12_2-1692058033831.png

    Finally, you can retrieve a message to check the final result.

    JoseC12_3-1692058518823.png

    Hope it helps,

    Best regards!

    Jose Donayre

     

  • creativeopinion Profile Picture
    10,508 Moderator on at

    @esang 

    Depending on how many items you need to loop through, it would be more efficient to use a Filter Array action. The Apply to Each + Condition actions will work as @JoseC12 indicated above. However it needs to loop through each item and run a check then increment the variable.

     

    Instead I would recommend the Filter Array action that can filter out the true and false values and provide you with a count. These two actions can run parallel to each other.

    creativeopinion_0-1692061267302.png

    Add Filter Array Action

    Add a Filter Array action to check for each each condition. 

    creativeopinion_1-1692061348652.png

     

    Count Items Returned

    Add a Compose action under each Filter Array action and use the length() function to count the number of items returned from the Filter Array action above. 

    creativeopinion_2-1692061399172.png

     

    The total flow run for my list of 24 items was about 1 second. This will vary based on the number of items you have in your list.

     

    Hope this helps!


    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Watch my tutorials on YouTube
    👉 Tips and Tricks on TikTok

     

     

     

     

     

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 664

#2
Haque Profile Picture

Haque 460

#3
Valantis Profile Picture

Valantis 357

Last 30 days Overall leaderboard