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

Validation on Selecting Submit Button

I created a PowerApp to allow employees to enter in a time allocation. I would like to ensure that on clicking the submit button on the "Edit Form" that if [Allocation 1] > 0 than [Fund 1] > 0. 

 

 

Sample Data:

Allocation 1 = 25

Fund = 

Allocation 2 = 40

Fund 2 = 3000

Allocation 3 = 30

Fund 3 = 2000

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Validation on Selecting Submit Button

Remove the square brackets, so it looks like this:

 

IsBlank(Allocation1)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

11 REPLIES 11
Super User
Super User

Re: Validation on Selecting Submit Button

Try wrapping an IF statement around the SubmitForm function.

 

If([Allocation 1] > 0 && [Fund 1] > 0, SubmitForm([EditForm]), false)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
skburke
Level: Powered On

Re: Validation on Selecting Submit Button

I tried your argument and I was on the same track except I realized that the fileds are text and not numbers. How would I rewrite the argument to indicate that if([Allocation1] is not blank and [Fund1] is blank than false?

Super User
Super User

Re: Validation on Selecting Submit Button

This should return false when [Allocation1] is not blank and [Fund1] is blank

 

Not(Not(IsBlank([Allocation1])) && IsBlank([Fund1]))
skburke
Level: Powered On

Re: Validation on Selecting Submit Button

This is close; however, for some reason even though I set the [Fund1] field default as "" the IsBlank command is reporting that the field contains data "true" even though I set it as "" and there is not data in Fund1. Any thoughts?

skburke
Level: Powered On

Re: Validation on Selecting Submit Button

I even tried to set the default of the input text field [Allocation1] to "Blank()" and IsBlank([Allocation1)] is still reporting false. I just do not get this. . .

Super User
Super User

Re: Validation on Selecting Submit Button

Are you testing this in designer? If so, look at the Default Mode property of the Form and if it says Edit change it to New and test again.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
skburke
Level: Powered On

Re: Validation on Selecting Submit Button

I made the suggested change and "IsBlank([Allocation1])" is still reporting "false". The field shows not data and default value is set to "Blank()"

Super User
Super User

Re: Validation on Selecting Submit Button

Remove the square brackets, so it looks like this:

 

IsBlank(Allocation1)


--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

skburke
Level: Powered On

Re: Validation on Selecting Submit Button

That seriously worked!!!!

 

In matter of fact, instead of creating 20 nested "if than loops" to the submit icon, I simply used the following formula on the "Fund1" Data Card / Required Field to "If(IsBlank(Allocation1), false, true)". This way is there is no data in "Allocation1" than the "Fund1" requirement is false. If their is data in the "Allocation1" field than the "Fund1" requirement is set to true. This is a much cleaner solution and much easier to program.

 

I appreciate the team effort in helping me solve my issue.

 

-Shawn

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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