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 / Hide Button after pres...
Power Apps
Answered

Hide Button after pressed | Button per item

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Having currently issues with button onselect.
Trying to make a item button disapear from item after being pressed.

So I already thought of using my sharepoint list and added an boolean collumn to make it work unique per item.


# In Button OnSelect
Set(buttonPressed, "ButtonName")

# In Label Visible
If(buttonPressed = "ButtonName", true, false)

 Once pressing on another item in my gallery the button is no more to be found. 

I am using this function for my send Email button.
Once the mail has been send the button still is vissible which is not good because the user can use it again and send the data again from that item.



Check out here for my previous issue, solved by @StalinPonnusamy .

Thanks,

Badr Khaie 

Student | ROC Mondriaan
Level 4 | Software/Website Developer
Badrkhaie@hotmail.com 




Categories:
  • Verified answer
    SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    Hi @Anonymous, if you already have a column to manage this, here is a suggestion:

     

    Make it single text called it EmailFunction, then in the button in the gallery, add a patch to OnSelect.

     

     

    Patch("SharePointList",
    
    ThisItem,
    
    {
    
    EmailFunction: "true"
    
    }
    
    )

     

     

    Then on the Visible property simply add:

     

    !(ThisItem.EmailFunction)

     

     

    What will happen when someone press the button in that Item Patch will add true and the button will disappear

     

    Don't rename the column simple delate and create new and don't forget to refresh connection to Sharepoint list in power apps

     

    Hope it helps

  • SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    @Anonymous 

     

    Just keep in minde that I assumed You have like the gallery of items and next to an Item you have an icon or button to press but if You have like a Button outside of the gallery this need to change slightly and you will need a Variable to control the Visible property of the button.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @SebS ,
    The solution that was shown did not work for me unfortunately.
    So there is the gallery with items shown.
    Once pressed on one item, the person will be redirected to the view page to look at the information of that item with a mail function button in the item.

    The mail fuction already works once pressed it runs an power automate. Temporarly removed this function 

    The button of this item can only be pressed once. So if I am reopening the same item trough the gallery I will see that the button is not there anymore/replaced with an text "Mail sent!"

    Badrkhaie_1-1669040669933.png

    Badrkhaie_2-1669040693233.png

     

    Badrkhaie_0-1669040491670.png

     



  • SebS Profile Picture
    4,867 Super User 2026 Season 2 on at

    Hi @Anonymous 

     

    Do this Icon is on top of the form right and it's not part of any Gallery? 

    If yes, the solution will be different You will need to add Set(varID, ThisItem.ID) on the gallery record pass it to the Mail button and validate Column EmailFunction if there is a true.

    Confirm where the icon is place and I will provide you with the solution.

     

     

    Regards

     

     

  • usernamed11 Profile Picture
    2 on at
    Hi, did you find a solution for your issu? I have the same problem

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    The solution was provided by @SebS one week ago.
    My own code was faulty which resulted in a error.
    Try this solution on a blank page

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 397 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 354

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard