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 / Gallery buttons being ...
Power Apps
Answered

Gallery buttons being visible or hided issue

(0) ShareShare
ReportReport
Posted on by 31

I am currently creating an "Event Registration" app.  I have a Gallery that has all the sessions that people can sign up for.  There is a "Seats Available" column and a "Seats Taken" column.  When an event is added the user will input how many seats are available for the event.  I have two button in the gallery called "Registered" and "Unregistered".  There are multiple events in the gallery and when someone registers for an event I want to hide that button and show the unregistered button if they change their minds.  The issue I am running into is that my current way of hiding and showing the buttons only work if only one account is using it.  Once someone else signs up for an event the buttons get all weird and people can start unregistering other people and mess up everything.  Any suggestions?

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,458 Most Valuable Professional on at

    Hi @DarkRoboHunter ,

    Please share the code (in Text) you are currently using to hide the button and why it only works on one account.

  • DarkRoboHunter Profile Picture
    31 on at

    Registered button Visiable: If(ThisItem.Seats=0,false, true) And If(LookUp('Event Registration',SessionID=ThisItem.'Event ID',SessionID),false, If(LookUp('Event Registration',UserEmail = User().Email,UserEmail),true,If(ThisItem.SeatsTaken=0,true,false)))

     

    Unregistered button visible: If(LookUp('Event Registration', Title= ThisItem.Title,Title), true, false) And If(LookUp('Event Registration',User().Email='User Email','User Email'), true, false)

  • WarrenBelz Profile Picture
    156,458 Most Valuable Professional on at

    Hi @DarkRoboHunter ,

    ]It is doing what it is asked

    If(
     LookUp(
     'Event Registration', 
     Title= ThisItem.Title,
     Title
     ),
     true,
     false
    ) And 
    If(
     LookUp(
     'Event Registration',
     User().Email='User Email',
     'User Email'
     ), 
     true,
     false
    )

    The second part is only showing if the 'User Email' field matches the current user's email - if you want an Orf(0 statement here, all you need on the Visible is

    LookUp(
     'Event Registration', 
     Title=ThisItem.Title
    ).Title ||
    LookUp(
     'Event Registration',
     'User Email' = User().Email
    ).'User Email'

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • DarkRoboHunter Profile Picture
    31 on at

    It still isn't quite there. It is showing in all gallery items.  I have 2 lists that these buttons are tied to.  One called, "Event Registration" where when you click the "Registered" button it creates an item from the "Sessions" list where the items in the gallery are hosted to the "Event Registration" where itt adds all required columns and also adds the user's info to it.  

     

    Then all I am trying to do is see if the items' SessionID(from "Sessions") is equal to EventID(from "Event Registrations) and the User().Email is equal to User Email(from "Event Registrations") then the "Registered" button hides. Then the opposite happens on the "Unregistered" button where it shows the button.

     

    I added and played around with the logic you (@ 

  • WarrenBelz Profile Picture
    156,458 Most Valuable Professional on at

    Hi @DarkRoboHunter ,

    If you simply want alternate visibility and the first formula is working for you, just change the second button Visible to 

    !YourFirstButton.Visible

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Verified answer
    DarkRoboHunter Profile Picture
    31 on at

    Nothing was working quite right once someone else tried to sign up for an event.  However, I did figure out a workaround that took out the LookUps and instead used MS Flow to update an event item to add the individuals' emails then check the User().Email is in Attendees' Email column.  Thank you for your help! 

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