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

Submit Form If required fields are filled then naviagte

When building my power apps, I noticed that it didn't matter if I filled the "required" fields or not. Power Apps always navigated me to the "End Screen". The form itself was not submitted.

My question now is, how do I build a formula so that Power Apps only navigates the user to the "end screen" when the "required" fields are filled and not left empty?

 

I don't need anything complex, just something to show the User that he missed required fields and is able to fill them.

 

Current Formula:

 

SubmitForm(['EditForm NSI']);;
Navigate('End Screen');;
Fade

 

 

I also tried to use this formula:

 

If(
   EditForm NSI.Valid && 
   DataCardValue12_2.Text <> "" &&
   DataCardValue18_2.Text <> "" &&
   DataCardValue20_2.Text <> "" ,
   SubmitForm('EditForm NSI');
   NewForm('EditForm NSI');
   Navigate('EditForm NSI'),
   Notify("Please enter the Required fields",NotificationType.Error);
   Navigate('End Screen') 
)

 

 But it didn't work.

1 ACCEPTED SOLUTION

Accepted Solutions
PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @KT03 ,

 

Try below code if it helps. 

 

if(EditForm NSI.Valid && !IsBlank(DataCardValue12_2.Text); SubmitForm('EditForm NSI');;
   NewForm('EditForm NSI');;
   Navigate('EditForm NSI');Notify("Please enter the Required fields",NotificationType.Error);;Navigate('End Screen') )

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

9 REPLIES 9
Ethan_R
Continued Contributor
Continued Contributor

Hi @KT03 ,

 

If your DataSource has required fields then it will show in the form.

For non-required fields from DataSource.

Don't use the formula to calculate manually if field is filled or not.

 

Click on the DataCard of the fields you want to mark as Required.

Navigate to field's advance option on the right of the screen.

Unlock the DataCard (if prompted)

Search Required property and set it as true

 

Now you will have '*' mark in your form.

 

If you do not insert values within the fields. Form won't submit and show error.

--------------

 

Now, If you still need some manual checking

Use formula as such,

!IsBlank(DataCardValue1.Text) or DataCardValue1.Text = Blank() then proceed with the code. 

 

For Example;

 

//From your code

If(DataCardValue12_2.Text = Blank(), //code here if true, //code here if false)

or

If(!IsBlank(DataCardValue12_2.Text), //code here if true, //code here if false)

 

 

Hope this helps.

 

 

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @KT03 ,

 

Try below code if it helps. 

if( EditForm NSI.Valid ||  IsBlank(DataCardValue12_2.Text) ||
   IsBlank(DataCardValue18_2.Text) ||
   IsBlank(DataCardValue20_2.Text),  Notify("Please enter the Required fields",NotificationType.Error);Navigate('End Screen') ,SubmitForm(['EditForm NSI']);
NewForm('EditForm NSI');
   Navigate('EditForm NSI'))


OR

if( EditForm NSI.Valid ||  IsBlank(DataCardValue12_2.Text) ||
   IsBlank(DataCardValue18_2.Text) ||
   IsBlank(DataCardValue20_2.Text);  Notify("Please enter the Required fields",NotificationType.Error),Navigate('End Screen') ;SubmitForm(['EditForm NSI']),
NewForm('EditForm NSI'),
   Navigate('EditForm NSI'))

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Hello @PG_WorXz10 i am still receiving issues 

KT03_0-1632226197210.png

any suggestions?

 

 

 

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @KT03 

What is the error message ? Can you check if comma or semicolon issue there ?

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

Ethan_R
Continued Contributor
Continued Contributor

Hi @KT03 ,

from your error message,

Notify(<text> , <type>) there's a comma and not semi-colon.

 

 

If(
   EditForm NSI.Valid && 
   !IsBlank(DataCardValue12_2.Text) &&
   !IsBlank(DataCardValue18_2.Text) &&
   !IsBlank(DataCardValue20_2.Text) 
   ,
   SubmitForm('EditForm NSI');
   NewForm('EditForm NSI');
   Navigate('EditForm NSI')
   ,
   Notify("Please enter the Required fields",NotificationType.Error);
   Navigate('End Screen') 
)

 

 

KT03
Regular Visitor

I am from germany, as soon as i use "," it is shwoing an error Massage, so i use ";".

PG_WorXz10
Resident Rockstar
Resident Rockstar

Any of below code works in your case without any error notification ? 

 

if(  EditForm NSI.Valid ||  
     IsBlank(DataCardValue12_2.Text) ||
     IsBlank(DataCardValue18_2.Text) ||
     IsBlank(DataCardValue20_2.Text);  
	 Notify("Please enter the Required fields",NotificationType.Error),Navigate('End Screen') ;
	 SubmitForm(['EditForm NSI']),
     NewForm('EditForm NSI'),
    Navigate('EditForm NSI')
	
	)
	

OR	
	
	
	If(
   EditForm NSI.Valid && 
   DataCardValue12_2.Text <> "" &&
   DataCardValue18_2.Text <> "" &&
   DataCardValue20_2.Text <> "" ;
   SubmitForm('EditForm NSI'),
   NewForm('EditForm NSI'),
   Navigate('EditForm NSI');
   Notify("Please enter the Required fields",NotificationType.Error),
   Navigate('End Screen') 
)

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

I am still not able to use the Formulas because of the "," i tried the second one with ";" and it didn't show any error Notification but it is not saving or redirecting the User.

 

KT03_1-1632301946291.png

 

PG_WorXz10
Resident Rockstar
Resident Rockstar

Hi @KT03 ,

 

Try below code if it helps. 

 

if(EditForm NSI.Valid && !IsBlank(DataCardValue12_2.Text); SubmitForm('EditForm NSI');;
   NewForm('EditForm NSI');;
   Navigate('EditForm NSI');Notify("Please enter the Required fields",NotificationType.Error);;Navigate('End Screen') )

 

 

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.

If this post was helpful or you need more help please consider giving Thumbs Up and Tag me in your reply I'll be happy to help. If this post helped you solve your issue please click Accept as solution and provide Thumbs Up. This will help others find it more readily.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,389)