cancel
Showing results for 
Search instead for 
Did you mean: 
hpkeong

How to Create UserName & UserID to improve Access Control

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.

 

  1. 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]

 

  1. Insert a Dropdown (name it as DDUserName) and tie it to:

Dropdown. Items

= Distinct(Passkey, UserName)

 

  1. Insert a TextInput box to enter UserID: Name it as TextUserID

 

  1. 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:

  1. 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).
  2. 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 & UserIDSample UserName & UserIDuserName.UserID = TextInputuserName.UserID = TextInputUserName <> UserIDUserName <> UserIDUserName.UserID = TextInputUserName.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,Access Key Pad No,Boss match with User ID..All Access Show-UpBoss match with User ID..All Access Show-UpAccess Control for employee.Access Control for employee.

 

Comments