cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How could you create a pin number input?

Hi All,

 

I'd like to create a screen that looks very similar to ATM where you would input a pin.

 

i.e. you would have number buttons from 1-9 with a zero button below the number in the centre. You would then have a clear button on the left of the zero and and enter button on the right of the zero.

 

Pin: 0000

 

1       2       3

4       5       6

7       8       9

clear 0 enter

 

At the top of the screen you would have a text box showing what numbers you've pressed.

 

How would you setup the onselect and text boxes so that it would concatenate the number you've pressed so that it would appear as a pin being entered at the top.

 

Thanks in advance for all your help.

 

Dave 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Meneghino
Community Champion
Community Champion

Start with the clear button OnSelect

Set(MyPin, "")

Button 1 OnSelect:

Set(MyPin, MyPin & "1")

and so for all numbers

 

The label at the top simply shows

"Pin: "&MyPin

You may want to set the DisplayMode property of the number buttons to:

If(Len(MyPin<=4), Edit, Disabled)

And set the DisplayMode of the enter button as:

If(Len(MyPin)=4, Edit, Disabled)

 

View solution in original post

7 REPLIES 7
Meneghino
Community Champion
Community Champion

Start with the clear button OnSelect

Set(MyPin, "")

Button 1 OnSelect:

Set(MyPin, MyPin & "1")

and so for all numbers

 

The label at the top simply shows

"Pin: "&MyPin

You may want to set the DisplayMode property of the number buttons to:

If(Len(MyPin<=4), Edit, Disabled)

And set the DisplayMode of the enter button as:

If(Len(MyPin)=4, Edit, Disabled)

 

JRaasumaa
Memorable Member
Memorable Member


@Anonymous wrote:

Hi All,

 

I'd like to create a screen that looks very similar to ATM where you would input a pin.

 

i.e. you would have number buttons from 1-9 with a zero button below the number in the centre. You would then have a clear button on the left of the zero and and enter button on the right of the zero.

 

Pin: 0000

 

1       2       3

4       5       6

7       8       9

clear 0 enter

 

At the top of the screen you would have a text box showing what numbers you've pressed.

 

How would you setup the onselect and text boxes so that it would concatenate the number you've pressed so that it would appear as a pin being entered at the top.

 

Thanks in advance for all your help.

 

Dave 🙂


 

We actually have an in house Time Clock that I built that is very very similar.

 

To add to @Meneghino's ideas we also have a mask field that updates with each button click so I can change the text box at the top of the attached image to show the pin as masked once it's entered.

 

timeclock.png

 

timeclock2.png

 

The "No/Esc" button clears the values by settings them to ""

 

There is also code to check the Length of the entered "pin" to stop users from entering it beyond 5 values.

 

Otherwise it works great, if you have any other questions let me know!

 

Anonymous
Not applicable

Thanks so much it works a treat!

Anonymous
Not applicable

Hi all,

 

This has worked really well, now I'd like to add to this by adding a table of Users and PIN numbers and be able to identify who has logged in using a PIN.

 

For example: I have a 3 column table Name,Group,PIN With the persons Name which Group within the company they work in such as Sales or Operations with the 3rd column being individual PIN numbers for each.

 

What I'd like to be able to do is after the user has typed in the PIN set a variable to advise which user is currently logged in that I can then use in a Label as well saying who has logged in.

 

So simple Login

 

How I'd Set a Variable with who's logged in.

 

Create a label showing the name of who has logged in using the PIN. 

 

Thanks in advance

 

 

Dave

Meneghino
Community Champion
Community Champion

IMHO you would be much better off with the User() function and/or the Office365Users connector and using the in-built functionality rather than duplicating it and having your user have to remember yet another PIN/password.

https://docs.microsoft.com/en-us/powerapps/functions/function-user

https://docs.microsoft.com/en-us/powerapps/connections/connection-office365-users


@Anonymous wrote:

Hi all,

 

This has worked really well, now I'd like to add to this by adding a table of Users and PIN numbers and be able to identify who has logged in using a PIN.

 

For example: I have a 3 column table Name,Group,PIN With the persons Name which Group within the company they work in such as Sales or Operations with the 3rd column being individual PIN numbers for each.

 

What I'd like to be able to do is after the user has typed in the PIN set a variable to advise which user is currently logged in that I can then use in a Label as well saying who has logged in.

 

So simple Login

 

How I'd Set a Variable with who's logged in.

 

Create a label showing the name of who has logged in using the PIN. 

 

Thanks in advance

 

 

Dave


 

If you simply have another column with a true/false for being logged in would that work?

 

Then when they type in their pin if it's found then flip the column to true so you can display they are logged in. We do this but also capture the date/time of every punch in a log so you can see when they last logged in too.

Can I get a copy of your solution as well?

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (3,185)