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,
Solved! Go to Solution.
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
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
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.
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!"
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
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