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 / Button Visible based o...
Power Apps
Answered

Button Visible based on 2 columns of SP List

(0) ShareShare
ReportReport
Posted on by 21

Hello all I have been searching and I am stumped.  

 

++Edit++ added some posts with more context.  Basically I need a button visible if their email is in the SP List and a specific value is in a multi select field of their SPList entry.

 

I have a Power App with buttons that are visible if the logged in user exists in a SP list using the following works where DataSource is my SP List with a column of Email

 

Visible = If(User().Email in 'DataSource'.Email, true)

 

That same SP List has a Department Column which is a multiple choice and I would like to show buttons only to users that need them.

 

For instance a button called "Update Tax" should only be visible to a user whose email is in the SP List Email column and Tax is one of the selected values in the Department column

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @tjpreissig 

    Visible property of first button described above:  !IsBlank(Lookup(spList, Email=User().Email))

    Visible Property of "Update Tax" button:  

     

    !IsBlank(LookUp(spList, Email=User().Email)) && 
    !IsBlank(LookUp(splist, "Tax" in Department.Value))

    If(... not needed since the statement above reduces to true or false

     

     

  • tjpreissig Profile Picture
    21 on at

    That worked thank you!  I do get a warning of "Delegation Warning. The highlighted part of this formula might not work correctly on large data sets."  I assume with the SP List only having 20 or less entries I should be ok?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @tjpreissig 

    You will always get a delegation warning when the "in" operator is used in SharePoint. As long as your list is <500 items you can ignore it. 

  • tjpreissig Profile Picture
    21 on at

    Sorry to bother again, this kind of works.  What is going on is if Anyone on the list has Tax assigned it is visible for everyone.  It needs to be if their email is on the list and tax is there for their name

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @tjpreissig 

    Please post the visible property of the 2nd button. If you used my formula it shouldn't be possible as both conditions need to be satisfied for the button to be visible. Test the second condition by putting a datatable on a screen with 

    Filter(splist, "Tax" in Department.Value) in its items property and see what you get.

  • tjpreissig Profile Picture
    21 on at

    !IsBlank(LookUp('SPLIST', Email=User().Email)) &&
    !IsBlank(LookUp('SPLIST', "Tax" in Department.Value))

     

    The problem if the SPLIST has me and you in it but only I have Tax as a value in the Department Column then the button will be visible for both of us if I understand it right the visible property is just looking to see if "Tax" is present not necessarily for the combination of email and Tax

     

     

  • tjpreissig Profile Picture
    21 on at

    There are 6 buttons with corresponding departments in the multi-choice column of the SPList the desired effect would be you have 3 options selected in your department column then you get those 3 buttons while I will get only the buttons I have selected there.  Right now the Visible command is the same for all 6 only with "Tax" changed to the correct option.  This works fine for a single user however as soon as a second user is added both users get buttons for all users.  I hope I am explaining it correctly

  • tjpreissig Profile Picture
    21 on at

    tjpreissig_0-1661452394752.png

    here is my SP List User 1 should only have the Access Button, User 2 should have Access and Org, while User 3 should have them all.  Currently all users have all buttons because all the department exists on user 3

  • Verified answer
    tjpreissig Profile Picture
    21 on at

    I was able to solve this with the following

     

    If(
    CountIf('SPList', User().Email in Email && "Tax" in Department.Value),
    true,
    false
    )

     

    Not sure if that is the best way but it seems to work.

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 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard