cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

Disable Submit button until all radio button options in a gallery are selected

Hi,

I am putting together an audit app. I want to make sure that all the questions are answered before the audit can be submitted. I have the questions in a gallery and am trying to use a ForAll and IsBlank function in the DisplayMode setting of the SUBMIT button. But, I keep getting an error regarding an expected enum value:

auditapp.png

Can anyone help, please? 

Note that the radio button options are just 'Yes' and 'No'. The extra text after no is just a label. I have tried:

ForAll(HSAuditGallery1.AllItems,If(((Radio1.Selected.Value="Yes") Or (Radio1.Selected.Value="No")),DisplayMode.Edit,DisplayMode.Disabled))

but that doesn't work either.

Thanks,

Izzy.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Hi @IzzyWizz ,
You can't use a ForAll like that in a static property like DisplayMode - try this

If(
    "||" in Concat(
        HSAuditGallery.AllItems,
        Radio1.Selected.Value & "|"
    ),
    Disabled,
    Edit
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

5 REPLIES 5
Highlighted
Super User III
Super User III

Hi @IzzyWizz ,
You can't use a ForAll like that in a static property like DisplayMode - try this

If(
    "||" in Concat(
        HSAuditGallery.AllItems,
        Radio1.Selected.Value & "|"
    ),
    Disabled,
    Edit
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Highlighted

Hi @WarrenBelz ,

Perfect, thanks.

Izzy.

Highlighted

Hi @WarrenBelz ,

I am trying to understand and apply your code to a second gallery where I have a text input control in each data card and I want the submit button to be disabled until there are values greater than 0 in the text input control for all items of the gallery (I have set the default as 0 as the result box uses If statements based on the value).

wateraudit.png

As I understand it, your code says, if there is a || when you join together all of the Radio1.Selected.Values and | for all the items in the HSAudit Gallery, the button is disabled, if not it is useable (in edit mode). But, what is the || and | and how do they relate to whether the Radio1 button is selected or not? 

Perhaps this should be a new question but I thought it might be useful if you are looking up the question above?

Thanks,

Izzy.

Highlighted

Hi @IzzyWizz ,

You can use any separator you want : and :: would do the same job.

What I have done is use them in a Concat statement to put them between the values, so if there are two in a row ||, there must be a blank value in the set.

Highlighted

Hi @WarrenBelz ,

Oh I see! The "|" doesn't have any special meaning, the "&" just puts one in between each radio button answer and if you get two in a row (the "||" with 'in' looks for two together) that is where there wasn't an answer. I have now used it for my second scenario, adding a 0 between each item and looking for 00. Thanks for explaining.

Izzy.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,366)