Announcements
In power app i have two login button “Admin” and “User “ . all user have 0365 account once they login in O365 account i have one app developed by SharePoint and power app. In Admin login i want to login only for selected Admins but in user all can login.
how to prevent Admin login by look up user role list from SharePoint those who are not in Admin user Role list?
If you want to implement this, there is a workaround - you can create a sharepoint list with one item in it, and the item-level permissions are set that only Admin role can view, everyone else has no access.
Then inside your app you can check if CountRows(AdminListName) > 0, if yes then the person is an admin role, otherwise they are a user - you can then use this logic to define if the currently logged in user is an admin or not.
f(TextInput2.Text exactin Home_Screen.UserName And LookUp('Users Role','UserName'.Password=TextInput2.Text.Password=TextInput3.Text,Notify("Login Sucessfull",NotificationType.Success,2000),Notify("Invalid Credentials",NotificationType.Error,2000)),Navigate(Admin_Screen)
i have used the above code on login but still not working incompatible type of comparison warning error
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 234 Super User 2026 Season 2
WarrenBelz 207 Most Valuable Professional
Mohsin Ali 169