cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Chrom3d
Level: Powered On

Datacard value required to submit form

I have form that requires a visitor to put in the name of the person they are visiting. as per the image below, if the person to visit is chosen, an email will be sent to them through Flow. 

 

My issue is, if the datacard is not filled, the form does not submit but instead navigate to the 1st page and an error msg pops out. Being a noob in Powerapps, I need help to refine the script.

 

My current script on the button is :

 

PowerAppsbutton.Run(DataCardValue7_1.Selected.Email,DataCardValue2_1,DataCardValue4_1);SubmitForm(Form2_1);Navigate(Screen1,ScreenTransition.Fade)

 

I want it to not navigate but stay on the same screen if the Datacard (Person to Visit) is not filled in and let them know they need to fill up the Person to Visit field.

 

I tried this script:

 

If(IsBlank(DataCardValue4_1), Navigate(Screen3_1),PowerAppsbutton.Run(DataCardValue7_1.Selected.Email,DataCardValue2_1,DataCardValue4_1);SubmitForm(Form2_1);Navigate(Screen1,ScreenTransition.Fade))

 

but it doesn't work

 

Capture.PNG

 

 

Any help will be appreciated.

4 REPLIES 4
BitLord69
Level 10

Re: Datacard value required to submit form

Move the call Navigate to the form's OnSuccess. That way you will only change screen only if the save operation is successful. If you keep it as it is, you will always go to Screen1. 

 

You might also want to move the emailing part to the OnSuccess. That way you will only be sending the mail when you know the form is properly filled out. 

 

One last note, why not use the Office 365 Outlook connector and send the mail right from within your app? You can read more about the connector here: https://powerapps.microsoft.com/en-us/tutorials/connection-office365-outlook/

 

Good luck!

Chrom3d
Level: Powered On

Re: Datacard value required to submit form

Hi Bitlord69

 

Sorry I haven't moved on to this project of mine but would love to finish it. I haven't tried the Outlook connector, I'll look more into it. What is the advantage of having the outlook connector rather than using Flow to send emails? I'm a total noob btw, I am amazed on how far I got with doing this log in app for a company with issues. 

 

I'll give your advise a try on the OnSuccess and let you know of the progress.

 

Thanks so much! 

 

Chrom3d

 

BitLord69
Level 10

Re: Datacard value required to submit form

Good morning!

 

I have no hard facts about  the use of Flow vs the Outlook connector, but for me I feel it adds unnecessary complexity to leave PA and call another service to get things going. Sure, if you have complex things to do Flow is probably very good to use, but for just sending an email, not so sure. Maybe someone more experienced can shed some lights on this.

 

Also, I think you have a limited amount of runs in Flow, so using those for a simple thing like sending an email maybe isn't the best.

 

If you stay within the confines of PowerApps I feel I have better control of things (albeit, probably imaginary! :p)

 

 

mikepilgrim
Level: Power Up

Re: Datacard value required to submit form

This has nothing to with the question. I'm new, please can somebody tell me how to post my own question? 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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