cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rdorman
Regular Visitor

Validation of checkboxes for multivalue field needing 2 clicks

I have created a PowerApps application based upon a SharePoint list. This application utilises a multi screen form to step the user through the form completion process.

 

On some pages of my form there are multi value fields that I need to capture. I have converted these fields from the standard combobox that PowerApps generates for the datacard to a series of checkboxes within gallery following instructions I found in a  YouTube video.

 

This is an example of one of my checkbox fields. As you can see this is a mandatory field, and I therefore need to validate it before moving to the next screen of the form.

rdorman_0-1635350660676.png

To validate the screen I have a Next page button with the following code:

 

If(!frmBasicInfo.Valid Or IsEmpty(colRequirementsData), SubmitForm(frmBasicInfo),Navigate(scrSummary));

 

 

The datacard properties are set as follows:

rdorman_1-1635350977592.png

and the OnCheck and OnUncheck properties of the checkboxes look like this:

rdorman_2-1635351045391.png

 

The problem I am having is that even if I complete all mandatory fields on the screen, when I click the Next screen button I get:

rdorman_3-1635351141779.png

But no other validation errors appear. If I then click the Next page button a second time, it goes through to the next screen as expected. 

Can anyone see what I might be doing wrong and how I can avoid having to click next twice?

 

2 REPLIES 2
poweractivate
Community Champion
Community Champion

@rdorman 

 

If(!frmBasicInfo.Valid Or IsEmpty(colRequirementsData), SubmitForm(frmBasicInfo),Navigate(scrSummary));

 

I am unsure because the If condition as you have written in your post, seems to state that if the form is not valid or, if something else is empty, then submit the form - otherwise navigate to another screen. It looks like you submit a form in the case the form is not valid.  I am a bit unclear why it is that you are doing it this way, maybe there is a reason you're doing it like that but I can't think of why at the moment, so you can start by checking closely on this first is all I can say for now.

Yes, you are correct. I am calling to Submit the form if the form is not valid. The reason for this is that calling SubmitForm triggers the PowerApps validation and shows the errors for the required fields. I am not actually wanting to submit here, just move to the next screen if the fields on the current screen are valid.  I do submit everything at the end by patching the individual screens.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,194)