cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KT03
Frequent 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
Super User
Super User

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.

KT03
Frequent Visitor

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.

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
Frequent 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.

KT03
Frequent Visitor

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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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