cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

HIde button until form is complete

I have a form where the submission button should only light up if all the fields in the form are filled in. Here is what I have on the default for the toggle. !IsBlank(DataCardValue1.Text)&& !IsBlank(DataCardValue6.Text) && !IsBlank(Label3.Text) && !IsBlank(DataCardValue9.Text)&& !IsBlank(Label6.Text)&& !IsBlank(DataCardValue7.Text). On the display mode for the submit button I have this If(tglvalidform.Value, Edit, Disabled). It only works if there are only two && once I put the others the button never lights up. I am not sure what I am doing wrong here.

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Super User
Super User

Try re-arranging and putting all the && first and then add the ||.  If that won't work you are going to have to write it differently like this:

 

If(First series of &&, ||, true,

Second series of &&, ||, true,

false,

)

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

11 REPLIES 11
JR-BejeweledOne
Super User
Super User

Have you tried putting tglvalidform.Value in a label to make sure it's giving you the true/false value you expect?

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
RandyHayes
Super User III
Super User III

@powerapps890 

As a suggestion...if all of those controls in your Formula are in your form, then set the Required property of your datacards that contain those controls to true

Then set your button DisplayMode property to: If(yourFormName.Valid, Edit, Disabled)

No need for a separate toggle control.  The form will do the validation for you.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

I think you may have meant .Valid rather than .Value  to check if all the fields in the form are valid for submission.

    If(yourFormName.Valid, Edit, Disabled)

RandyHayes
Super User III
Super User III

@James_McKie 

Thanks for noticing!  Sometimes I type ahead of my mind.  I corrected.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

I am confused about why I would put this on the datacard. When I do that to the datacard it makes the card gray out and I can't select anything. I just want the submit button to be grayed out until all the fields are filled in on the form. @RandyHayes 

I tried that and noticed if I take everything else out and leave two is blanks it works. When I add a third and it never changes to false..Is the syntax wrong?? So when I changed it to this !IsBlank(DataCardValue1.Text)&& !IsBlank(DataCardValue6.Text)  the button lit up when I filled in datacardvalue6 but if I added another datacard value it never lights up @JR-BejeweledOne 

JR-BejeweledOne
Super User
Super User

Are you sure when you added the 3rd IsBlank that you included the !?   I have written these sorts of formulas and included 7 or 8 or more fields and haven't had this sort of issue.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

!IsBlank(DataCardValue1.Text)&& !IsBlank(DataCardValue6.Text) || !IsBlank(Label3.Text) && !IsBlank(DataCardValue9.Text)|| !IsBlank(Label6.Text)&& !IsBlank(DataCardValue7.Text)&& !IsBlank(DataCardValue10.Text)|| !IsBlank(DataCardValue15.Text)&& !IsBlank(DataCardValue8.Text)|| !IsBlank(Label16.Text)&& !IsBlank(DataCardValue11.Text)&& !IsBlank(DataCardValue12.Text)&& !IsBlank(DataCardValue13.Text) - This is the new formula I put on the default for toggle and it works for the initial form submission. The issue with this is if the user were to go into the gallery and then picked that item the button would still be grayed even though everything is filled in. The reason I do the or is because the value on the comboboxes so away so I set the labels ThisItem.X. So when originally submitting the form it uses the actual data card, but if they want to update their form it relies on the label so be filled it which it is. I think there is somthing wrong with my syntax. For the data cards that are comboboxes I need either the label or the datacard to be filled in. @JR-BejeweledOne 

JR-BejeweledOne
Super User
Super User

Try re-arranging and putting all the && first and then add the ||.  If that won't work you are going to have to write it differently like this:

 

If(First series of &&, ||, true,

Second series of &&, ||, true,

false,

)

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (46,227)