cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

IfError with checkboxes

Hello,

 

I am trying to create a button which will display an error message when a single or multiple checkboxes haven't been selected inside of a gallery. I tried using:

IfError(Checkbox7_2.Value=false, Notify("Question Unanswered",NotificationType.Error))

 

But i haven't been able to get it to work.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: IfError with checkboxes

HI @Anonymous,

Do you want to display the error message when multiple Checkboxes have not been selected within your Gallery?

Based on the needs that you mentioned, I think the CountRows function and Filter function could achieve your needs.

I have made a test on my side, please take a try with the following workaround:3.JPG

Set the OnSelect property of the "Detect" button to following:

If(
CountRows(Filter(Gallery1.AllItems, Checkbox1.Value=true)) <= 1, /* <- Checkbox1 represents the Checkbox control within my Gallery*/
Notify("Question Unanswered", NotificationType.Error)
)

On your side, you should type:

If(
CountRows(Filter(YourGallery.AllItems, Checkbox7_2.Value=true)) <= 1, /* <- Checkbox7_2 represents the Checkbox control within your Gallery*/
Notify("Question Unanswered", NotificationType.Error)
)

In addition, if you want to display an error message when a single or multiple checkboxes haven't been selected inside your gallery, please take a try with the following formula:

If(
CountRows(Filter(YourGallery.AllItems, Checkbox7_2.Value=true)) < 1, /* <- Checkbox7_2 represents the Checkbox control within your Gallery*/
Notify("Question Unanswered", NotificationType.Error)
)

Or

If(
CountRows(Filter(YourGallery.AllItems, Checkbox7_2.Value=true)) = 0, /* <- Checkbox7_2 represents the Checkbox control within your Gallery*/
Notify("Question Unanswered", NotificationType.Error)
)

Please check the attached GIF screenshot for more details:

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
xyzzyx666
Level 8

Re: IfError with checkboxes

Hi @Anonymous,

 

Do you want the button to show Error Information if the checkbox not be selected?

I think you could change IfError to If:

If(Checkbox7_2.Value=false, Notify("Question Unanswered",NotificationType.Error)).

 

I have tested as next screenshot:

Button1.OnSelect:If(Checkbox1.Value=false,Notify("Question Unanswered",NotificationType.Error))

20190107test4.png

And the result is if the checkbox not be selected,it will show the error information:

20190107test4.gif

Anonymous
Not applicable

Re: IfError with checkboxes

Hey, 

 

Thanks a bunch for that example it fixed my issue, but is it possible for that to work with multiple checkboxes inside of a gallery.

xyzzyx666
Level 8

Re: IfError with checkboxes

Hi @Anonymous,

 

Do you mean the multiple checkboxes not be seleted the button should show error information?

I have used two checkboxes to test:

Button1.OnSelect:

If(Checkbox1.Value=false && Checkbox2.Value=false,Notify("Question Unanswered",NotificationType.Error))

The screenshot as:

20190108test1.png

Highlighted
Community Support Team
Community Support Team

Re: IfError with checkboxes

HI @Anonymous,

Do you want to display the error message when multiple Checkboxes have not been selected within your Gallery?

Based on the needs that you mentioned, I think the CountRows function and Filter function could achieve your needs.

I have made a test on my side, please take a try with the following workaround:3.JPG

Set the OnSelect property of the "Detect" button to following:

If(
CountRows(Filter(Gallery1.AllItems, Checkbox1.Value=true)) <= 1, /* <- Checkbox1 represents the Checkbox control within my Gallery*/
Notify("Question Unanswered", NotificationType.Error)
)

On your side, you should type:

If(
CountRows(Filter(YourGallery.AllItems, Checkbox7_2.Value=true)) <= 1, /* <- Checkbox7_2 represents the Checkbox control within your Gallery*/
Notify("Question Unanswered", NotificationType.Error)
)

In addition, if you want to display an error message when a single or multiple checkboxes haven't been selected inside your gallery, please take a try with the following formula:

If(
CountRows(Filter(YourGallery.AllItems, Checkbox7_2.Value=true)) < 1, /* <- Checkbox7_2 represents the Checkbox control within your Gallery*/
Notify("Question Unanswered", NotificationType.Error)
)

Or

If(
CountRows(Filter(YourGallery.AllItems, Checkbox7_2.Value=true)) = 0, /* <- Checkbox7_2 represents the Checkbox control within your Gallery*/
Notify("Question Unanswered", NotificationType.Error)
)

Please check the attached GIF screenshot for more details:

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 52 members 4,172 guests
Please welcome our newest community members: