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 / 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,502 Super User 2025 Season 2 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,502 Super User 2025 Season 2 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

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

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard