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

How to use countif

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Icha1288_0-1685694871191.png

I made this app, but i'm stuck on how to use countif on checkbox. 

i want to count how many checkboc that already check and i want to present the number on the box with (?). how to use the code countif? 

Icha1288_2-1685695012147.png

this is my database (sharepoint list), but i cant use counta because when people uncheck the checkbox it will be "-" where if poeple check the checkbox it will be "C". so if i do use counta the "-" will get count too. (i want to count only the "C")

 

 

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    Please try:

    Set(
     countCs,
     CountRows(MatchAll(JSON(YourDataSource),"\""C\"""))
    )

     

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    sorry i dont understand 

    Icha1288_0-1685698735787.png

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    1\You should add a button outside the gallery and set it's OnSelect property to:

    Set(
     countCs,
     CountRows(MatchAll(JSON(YourDataSource),"\""C\"""))
    )

    2\Select the button the value will be saved into the variable countCs

     

    Best Regards,

    Bof

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    sorry, and then what should i do? my datasource is my sharepoint list right? or the gallery? 

     

    but when i put database sharepoint list, it cant run. what did i do wrong?

    Icha1288_0-1685700158669.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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard