cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
paulb4
Helper I
Helper I

Create a simple counting PowerApp

Hello,

 

First of, sorry I really don't know anything about PowerApp so please be comprehensive...

 

I'd like to create a simple app which can be used to count people in a building.

I need that several people can use it simultaneously:

- You enter a number (let's say you type 50 (=people already in the building before counting starts))

- The person at the front door can Add 1 by pressing a button for every person who enters

- On the other side of the building another person can Substract 1 by pressing another button

That way I can have the real number of people in real time.

 

Can someone explain how to do that, please? What functions to type? And so on...

The best would be that the counting evolution would be saved somewhere (like a reporting) but I don't know how to do it...

 

It might look like this:

+1.PNG

See? Nothing fancy really...

 Thank you in advance!!

 

1 ACCEPTED SOLUTION

Accepted Solutions

@paulb4 

Yes, use the variable peopleCount in the Default property of the Text Input or the Text property of a label.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@paulb4 
Put this code in the OnChange property of the Text Input

 

Set(peopleCount, Value(TextInput1.Text))

 

Make sure to set the Format  property of the Text Input to this code

 

Number

 

Use this code in the OnSelect property of the +1 button

 

Set(peopleCount, peopleCount + 1)

 

Next, this code goes in the OnSelect property of the -1 button

 

Set(peopleCount, If(peopleCount > 0, peopleCount - 1))

 

To display the current number of people in the building put this code in the Text property of your label or text input.

 

peopleCount

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hello @mdevaney 

 

Sorry I don't know what you mean by the last step:

 

To display the current number of people in the building put this code in the Text property of your label or text input.

peopleCount

 

I don't understand where I am supposed to type "peopleCount"... Can you be more specific, please? Where is the Text property field?

 

Thank you!

 

@paulb4 

Yes, use the variable peopleCount in the Default property of the Text Input or the Text property of a label.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,332)