I have two forms. They are both connected to different data sources.
- form 1 is on screen 1
- form 2 is on screen 2
On-screen 1, I just want to validate the fields and upon successfully validating the field, I want to navigate to screen 2 (Not submitting form 1). Also, I would like to show all the empty fields just like below:
On-screen 2, I would like to validate form 2 and upon validating, submit form 1 and form 2 together.
---------------
form 1 is on screen 1
form 2 is on screen 2
Hi @yashp1196 ,
If not using SubmitForm to validate the form, you will have to set as many variables as the number of Data Cards, validate the form and determine whether navigating to the other screen on the Form's Valid property. If the Form is not valid, it means that there are empty fields in the form. Then Color of controls and Visible of error message Labels will change based on respective variables.
If(Form1.Valid, Navigate(Screen2),UpdateContext({DC1: DataCard1.Valid, DC2: DataCard2.Valid, DC3: DataCard3.Valid, ...})
Visible of error message Label in Data Card 1
!DC1
Data Card 2
!DC2
and so on.
BorderColor of DataCardValue1
If(DC1, Parent.BorderColor, Color.Red)
BorderColor of DataCardValue2
If(DC2, Parent.BorderColor, Color.Red)
and so on.
Best regards,
Thats a good idea @v-jefferni , but i do not want to submit the form on screen 1, because what if the users wants to go back from screen 2 to 1 to fix something.
Hi @yashp1196 ,
Since borders and error messages will come up only when you submit the form, you can validate the form first, if it's valid then navigate to screen2, if not, submit form to call out the error message.
OnSelect of the Next button:
If(EditForm1.Valid, Navigate(Screen2), SubmitForm(EditForm1))
on screen2, validate the form2 first, if it is valid then submit the two forms. But if it's not valid, submit form2 to call out the errors:
If(Form2.Valid, SubmitForm(Form1);SubmitForm(Form2), SubmitForm(Form2))
Best regards,
Form1.valid does not give you the below validation. What I am looking for is showing all the red borders and red messages.
Hi @yashp1196 ,
You can simply leverage the Valid property of the Forms:
So, you can navigate and submit form based on whether each form is valid.
If(Form1.Valid, Navigate(Screen2), Notify(...))
If(Form1.Valid && Form2.Valid, SubmitForm(Form1), SubmitForm(Form2))
Best regards,
MS.Ragavendar
27
mmbr1606
14
Super User 2025 Season 1
Michael E. Gernaey
13
Super User 2025 Season 1