web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / how to display and com...
Power Apps
Unanswered

how to display and compare a column value during a user login?

(0) ShareShare
ReportReport
Posted on by 127

I have  a login sharepoint list:

email,password,status, category

emailpasswordcategorystatus
account@mywebsite.comTest@123AccountantActive
helpdesk@website.comTest@321HelpDesk

Active

 

tigray@adey.comhelp@usIT

inactive

in my power apps i have  a sceen with 3 buttons[Accountant,Help Desk and Information Technology] linked to other screens.

a successfully logged in user will see, his/her  category active button while the other buttons will disabled.

example if  an accountant category user logged in, the user will see the button "Accountant" clickable while the others are disabled.

if a helpdesk user logged in, the user will see the "Help desk " button active while the rest buttons will be disabled.

how can i do that.?here is my login code,

If(
 CountRows(
 Filter(AssetLoginUsers, And(
 txtemail.Text = email,
 txtpassword.Text = password
 )
 )
 ) = 1,
 Navigate(
 homeDashboard,
 ScreenTransition.None
 ),
 Notify(
 "Invalid Password!!! Please Enter a Valid Password",
 NotificationType.Error
 )
);

help me in modifying and capturing the user category to compare it with button.

 

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @Sebey ,

     

    To identify logged in User, you can use User().Email to know the email of the user.

    Make the Email read-only in the email textbox

    As per your code, 

    I feel its Login button code, code can be as follows:

     

     

    If(
     !IsBlank(
     LookUp(
     AssetLoginUsers,
     email = User().Email && password = txtpassword.Text,
     ThisRecord
     )
     ),
     Navigate(homeDashboard, ScreenTransition.None),
     Notify(
     "Invalid Password!!! Please Enter a Valid Password", NotificationType.Error
     )
    )

     

     

     

    Hope this helps

  • Sebey Profile Picture
    127 on at

    thanks for  y our reply, to clarify,I want to disable some buttons for some users based on their category.

    example if the user is in category Accountant, the user will only see accountant button active but not other buttons. all users will navigate to the same screen but I want to disable some button links based on their categories.

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    You can use the same formula on the buttons as well.

    If you are using individual buttons for each item then you need to add validation for each, if buttons are using in gallery as a Table then validation needs to be added in the Table itself.

    //On DisplayMode for Accountant Department (Individual Button)
    If(User().Email = "account@mywebsite.com", DisplayMode.Edit, DisplayMode.Disabled)
    

     

    Hope this helps

  • Sebey Profile Picture
    127 on at

    I want to make something similar likes this:

    //On DisplayMode for Accountant Department (Individual Button)
    If(User().Email's department is accountant = "Accountant", DisplayMode.Edit, DisplayMode.Disabled)
    I want to show the corrosponding department name of the current user.
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Okay @Sebey ,

     

    Then where are you storing this Department data in the SP List for Users. 

    Based on your table, it seems emails were User's emails but if that's the Department.

    So, where do you have List of Users where you have defined their Department belongs in certain category?

     

    Based on that, you will need to add lookup and compare the data, then edit or disable the button.

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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard