cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
luvsql
Helper II
Helper II

Required Field Errors on each field not working when have more than 1 screen

If I create a form with all my fields on the same screen out of the box, add a Submit that posts to SharePoint, the default errors on each of the datacards work ie red and shows you which ones are filled in.

 

However, now that I have split my form into 2 screens, that doesn't work at all anymore.  Screen2 submit button uses Patch and posts to Sharepoint with data from both screens/forms and works perfect, however, if a required field isn't filled, nothing really happens.  The user gets the regular navigate to screen3 "thank you" but no clue that they didn't fill in a field properly on either Screen 1 or Screen 2 and nothing hits SharePoint.  

 

My Screen1 has a navigate button.   Can the app not show the regular red required field errors (ie the ones under the fields) when they click that one (ie only look at form1 data)?  If no errors, go to next screen.  Then on Submit button, verify form2 has no errors then do the patch and navigate to screen 3?

 

I'm not understanding why all the out of the box required and errors don't work if we split the form into 2 screens.  

4 REPLIES 4
RandyHayes
Super User
Super User

@luvsql 

Yes, splitting form and using patch to put them together like that will break form functionality.

Please have a look at this video on how to split forms properly without breaking them.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

What if we do not use the Screen1 as in your example and strictly have an app that is going to add new data (ie in your example I would only have scrnSection1, 2, 3 and no Screen1 and no + sign?  I can't create the needed variable on a screen I don't have.  Will this work without the item and variable being used in all of these formulas?  If I create another screen that has all of the fields onto one screen, we're back to the primary reason why I split the screens because I'm using phone canvas app and don't want the scroll bars down the size since they're so tiny, a user won't know to scroll and the button won't show at the very bottom.  

RandyHayes
Super User
Super User

@luvsql 

You might be missing the point of how this is done...your master form has all of the fields in it.  They do NOT need to all be visible.  In fact, the master form doesn't even need to be visible - it just needs to be the master form.

 

The other forms are all forms that simply provide their values to the master form.  Everything revolves around the master form.

 

As for the fact that you are planning to just add data, then you simply need to set the Item property or the glbCurrentRecord to a record that is produced from the Defaults(yourDataSource) function.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
luvsql
Helper II
Helper II

I've been able to fix my existing 3 screen that's in New default mode to have each screen verified and show each error for required fields.  On each screen is an arrow button.  I added this so if no errors goes to next screen and if not, shows the red errors for required fields.

 

If(Form1.Valid,Navigate(Screen2),SubmitForm(Form1))

 

On my last screen the submit is now:

 

If(Form2.Valid,Patch('datasourcename',Defaults('datasourcename'),Form1.Updates,Form2.Updates)
;Navigate(Screen3,None),SubmitForm(Form2))

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,381)