cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Robertjde
Helper V
Helper V

disable a button in a gallery after pressing

hello @ all

i have one button per column in my inspection check gallery to transfer the results to my database.

Now it happens that the results of the check are transferred twice because the user can press them several times. For this reason, after pressing the button once, I would like to disable the button, but only for the button in the relevant column.

I am thankful for every help

 
Deaktivieren.PNG
1 ACCEPTED SOLUTION

Accepted Solutions

Please try this (See Attached):
At the beginning of the OnSelect of the Button:

Collect(DisaButton, ThisItem.ID)

 
Then on the Displymode of the button:
If(ThisItem.ID in DisaButton, DisplayMode.Disabled, DisplayMode.Edit)
 
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution

View solution in original post

6 REPLIES 6
eka24
Super User
Super User

On the Displaymode of the button put :
If(ButtonName.Value=true,Displaymode.View,Edit)

Unfortunately that does not work (see screenshot).
"Value" is not recognized.

 

3.jpg

Set a variable on Onvisible of the screen:
Set(DisableButton,false)

On the OnSelect of the button put this formula after your main OnSelect action:
Set(DisableButton,true)


Then on the Displaymode of the button:
If(DisableButton=true,DisplayMode.Disabled,DisplayMode.Edit)

It works, but all the buttons in my gallery are disabled, so unfortunately not the solution to my problem. I just want to disable the button for that column in my gallery which is selected.

 

3.jpg

Please try this (See Attached):
At the beginning of the OnSelect of the Button:

Collect(DisaButton, ThisItem.ID)

 
Then on the Displymode of the button:
If(ThisItem.ID in DisaButton, DisplayMode.Disabled, DisplayMode.Edit)
 
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution

View solution in original post

Yeah, it works !!! I only used one variable on Onvisible of the screen and it runs great.

 

Thank you @eka24  for helping me

 

Here again for everyone in the community:

 

Set to Onvisible of the screen:

Clear (DisaButton)

 

At the beginning of OnSelect of the Button:
Collect (DisaButton, ThisItem .XY)

 
Then in the Displymode of the button:
If (ThisItem .XY in DisaButton, DisplayMode.Disabled, DisplayMode.Edit)

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,907)