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

Visible Property to false / DisplayMode to Disabled

I have a gallery with Items from SharePoint in PowerApps and would like the Confirm button to be Disabled until the User selects an Item or only 1(one) Item in the gallery. I have tried everything and still not working. Help!
Button is labeled btnConditions and Gallery is galConditions.

WellCheck.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

After the patch reset the gallery.

 

Patch(...);Reset('GalleryName')



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Jeff_Thorpe
Super User
Super User

Here is a way to disable the button until an item is selected. You will need to replace gallery with the name of your gallery and Title with the name of a text field in the gallery.

 

Property Formulas:

Gallery > Default > {}

Confirm > DisplayMode > If(IsBlank(Gallery.Selected.Title), DisplayMode.Disabled, DisplayMode.Edit)

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks. It works when I first apply the code however, after deselecting an option in the gallery, the Confirm button is still enabled instead of being disabled. Also, after pressing Confirm to Patch the record, when I come back to the screen the Confirm button is enabled without selecting any option in the gallery.

Jeff_Thorpe
Super User
Super User

After the patch reset the gallery.

 

Patch(...);Reset('GalleryName')



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Worked, thanks.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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