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

Create Variable

(0) ShareShare
ReportReport
Posted on by 254

Hello, I use program languages, but I don't know how to write it in Power apps. I have created variable Set(CriteriaCounter, 0), so in programic language it is int criteriaCounter = 0

This variable is going create number for each criteria depends on numbers of criteria in this code: ( you can just take a look only in two first If() functions )

Counter Code.png

Okay first if works right, but my variable CriteriaCounter is still 0, but I need to say CriteriaCounter++ or CriteriaCounter = CriteriaCounter +1, so in this case my variable will be changed, and I will get the rigth numbers. Please help😊

Categories:
  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    @Aleksandra1 

    CriteriaCounter++ would look like this in Power FX:

    Set(CriteriaCounter, CriteriaCounter+1) 

     

  • Aleksandra1 Profile Picture
    254 on at

    Yeah thank you , I am trying it now, but I can not understand where I can write it Counter Error.png

  • Aleksandra1 Profile Picture
    254 on at

    Yeah thank you , I am trying it now, but I can not understand where I can write it Counter Error.png

  • timl Profile Picture
    37,287 Super User 2026 Season 2 on at

    @Aleksandra1 

    It's not possible call Set in something like the Text property of a label, which is what I guess you're doing.

    You'd need to call Set from a behaviour property, such as the OnSelect of a button or icon.

    If you just want to display the count on a label, you'd be better off just writing a formula to show the count. Do you really need to store that value in a variable?

    Sum(
     If(DisputedCheckBox_1.Value,1,0), 
     If(DisputedCheckBox_2.Value,1,0), 
     If(DisputedCheckBox_3.Value,1,0), 
     If(DisputedCheckBox_4.Value,1,0)
    ) 
    

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard