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.
Solved! Go to Solution.
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.
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.
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.
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')
)
I am from germany, as soon as i use "," it is shwoing an error Massage, so i use ";".
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.
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.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
182 | |
47 | |
46 | |
34 | |
33 |
User | Count |
---|---|
260 | |
87 | |
79 | |
68 | |
67 |