cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Badrkhaie
Frequent Visitor

Hide Button after pressed | Button per item

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 




1 ACCEPTED SOLUTION

Accepted Solutions
SebS
Memorable Member
Memorable Member

Hi @Badrkhaie, 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


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

6 REPLIES 6
SebS
Memorable Member
Memorable Member

Hi @Badrkhaie, 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


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
SebS
Memorable Member
Memorable Member

@Badrkhaie 

 

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.

 


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
Badrkhaie
Frequent Visitor

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

 



Hi @Badrkhaie 

 

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

 

 


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
usernamed11
New Member

Hi, did you find a solution for your issu? I have the same problem

 

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,187)