Assuming that you sign in PowerApps with a WorkMail, in your dept. but you have few users, and you wish to control who use the apps, access right, etc.
Though this may not be a good idea due to data security, but it is a way of designing control right.
Here I wish to share on how to create:
- UserName
- UserID
so as to control who can actually use / access the apps, especially navigation to those Screens confidential to particular users.
Meantime, you may also Save the UserName to trace the last sign in user.
- Let say you have a database with UserName and UserID
[In this case, I manually create one and show at the bottom of the age]
- Insert a Dropdown (name it as DDUserName) and tie it to:
Dropdown. Items
= Distinct(Passkey, UserName)
- Insert a TextInput box to enter UserID: Name it as TextUserID
- Insert a TextBox (or any other Icon, Button, etc.) with message to show up when UserName & UserID match each other.
So, please set the Visible of the TextBox to:
TextBox.Visible
= If(LookUp(Passkey, UserName = DDUserName.Selected.Result).UserID = TextUserID.Text, true, false)
The formula above says:
- LookUp the Table called Passkey, and if the UserName is same as UserName selected from Dropdown, check if the corresponding UserID match the TextInput data (as in TextUserID).
- If Yes, true – it will become Visible = true and show up. Otherwise, it will be ivisible.
Hope this simple formula will hlep to create PassKey by modifying my sample here.
Sample UserName & UserID
userName.UserID = TextInput
UserName <> UserID
UserName.UserID = TextInput
Below Screenshots are the actual apps I have modified to use Number Key to suit today's trend. Just sharing.
Access Key Pad No,
Boss match with User ID..All Access Show-Up
Access Control for employee.
*This post is locked for comments