cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Data_Enthusiast
Post Patron
Post Patron

Disable button if not all options are selected

Hi Power Apps Community,

I am creating a form where users are required to select values from radio buttons - which is in a Gallery.

If all the radio buttons are not selected, the submit button should be disabled.

I currently have the following which is not working:

If(
    IsBlank(Radio2.Selected.Value),
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 I would really appreciate any assistance.

Thank you in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Data_Enthusiast 
You have the right general idea but galleries behave differently that a standalone radio buttons control.  To check all of the Radio button sets inside the gallery we must use its AllItems property and count the number of radio buttons with no selection.  Once the count equals zero we enable the button.

 

If(
    CountRows(Filter(Gallery1.AllItems, Radio2.Selected.Value=Blank()))=0,
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@Data_Enthusiast 
You have the right general idea but galleries behave differently that a standalone radio buttons control.  To check all of the Radio button sets inside the gallery we must use its AllItems property and count the number of radio buttons with no selection.  Once the count equals zero we enable the button.

 

If(
    CountRows(Filter(Gallery1.AllItems, Radio2.Selected.Value=Blank()))=0,
    DisplayMode.Edit,
    DisplayMode.Disabled
)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi @mdevaney 

Thank you for the response. 

I received the following error when using the code.

Data_Enthusiast_1-1604168183364.png

 

 

@mdevaney 

There was a ')' missing:

If(
    CountRows(Filter(Gallery1.AllItems, Radio2.Selected.Value=Blank()))=0,
    DisplayMode.Edit,
    DisplayMode.Disabled
)

Thank you for the help 😀 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,166)