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

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
eka24 Community Champion
Community Champion

Re: disable a button in a gallery after pressing

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 Community Champion
Community Champion

Re: disable a button in a gallery after pressing

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

Re: disable a button in a gallery after pressing

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

 

3.jpg

eka24 Community Champion
Community Champion

Re: disable a button in a gallery after pressing

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)
Robertjde Helper II
Helper II

Re: disable a button in a gallery after pressing

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

eka24 Community Champion
Community Champion

Re: disable a button in a gallery after pressing

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

Robertjde Helper II
Helper II

Re: disable a button in a gallery after pressing

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Power Platform 2020 release wave 1 plan

Power Platform 2020 release wave 1 plan

Features releasing from April 2020 through September 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,708)