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

Submit A clear farm

Hello guys

In the new app that I’m trying to create from the scratch, in the main menu I have an “add button” Which opens an empty form and allows me to input the data .

In case of the user by accident press the submit button with no data in this form, I would like to inform the customer that he needs to input the data into the form.

Is there a Way to Notify the user?
1 ACCEPTED SOLUTION

Accepted Solutions
emh
Level 8

Re: Submit A clear farm

Hello,

 

Yes, if you have required fields, then PowerApps will display that message if the SUBMITFORM function is called and those fields are not filled in.

 

If you do not want the SUBMIT button to be enabled until these fields are filled in then you can add some additional criteria to your SUBMIT button's DisplayMode property:

If(AND(yourformname.unsaved, !IsBlank(datacard1), !IsBlank(datacard2)), DisplayMode.Edit, DisplayMode.Disabled)

 

If you want to clear the form and add a new record then after your SUBMITFORM function, set the form's DisplayMode to NEW. I think the NewForm function will automatically reset the entire form.

SUBMITFORM(yourformname); NewForm(yourformname)

 

Hope this helps.

3 REPLIES 3
emh
Level 8

Re: Submit A clear farm

Hello,

 

Yes there are a few ways. The easiest way is to use the form's unsaved property. This returns a true or false. For the submit button on its DISPLAY MODE property: If(formname.unsaved, DisplayMode.Edit, DisplayMode.Disabled)

 

Hope this helps.

ANdreVT
Level: Powered On

Re: Submit A clear farm

Hello @emh 

Your suggestion worked properly.

Thanks for that.

Now I have two required fields (DataCards) which is showing the message "An entry is required or has an invalid value. Please correct and try again."

After this step, i would like to reset this 2 fields and allows the user a try insert again.

Could you please help me?

emh
Level 8

Re: Submit A clear farm

Hello,

 

Yes, if you have required fields, then PowerApps will display that message if the SUBMITFORM function is called and those fields are not filled in.

 

If you do not want the SUBMIT button to be enabled until these fields are filled in then you can add some additional criteria to your SUBMIT button's DisplayMode property:

If(AND(yourformname.unsaved, !IsBlank(datacard1), !IsBlank(datacard2)), DisplayMode.Edit, DisplayMode.Disabled)

 

If you want to clear the form and add a new record then after your SUBMITFORM function, set the form's DisplayMode to NEW. I think the NewForm function will automatically reset the entire form.

SUBMITFORM(yourformname); NewForm(yourformname)

 

Hope this helps.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 500 members 4,575 guests
Recent signins:
Please welcome our newest community members: