cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abd3127
Kudo Kingpin
Kudo Kingpin

Using validations on a form

Hello Guys,

 

I have a sharepoint list with 20+ columns, and i am using forms for these columns. 

I have created more than 2 screens and using below formula

Patch(DataSource, Item_Being_Edited, Form1.Updates, Form2.Updates, Form3.Updates).

This query saves the data perfectly in the list.

But while saving the data, it does not give validation error even if one of my field is blank (when using "SubmitForm()" function it gives validation error)

Is there any way to achieve this using forms those are on more than 2-3 screens?

8 REPLIES 8
v-monli-msft
Community Support
Community Support

Hi @abd3127,

 

What did you mean by it give validation error if one field is blank. If the fields are not marked as required from SharePoint list, then when you submit the record from PowerApps, even if this field is empty, there will be no error. 

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bdodu
Responsive Resident
Responsive Resident

I thing you should read the following 2 links:

 

A Few Best Practices In Data Validation

 

Validate Function

Shanescows
Super User
Super User

Try this video on powerapps conditional formatting. You will need to implement some of these concepts. 

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
ericonline
Community Champion
Community Champion

Hello @abd3127. Be sure to use the "Required" property for data cards that you want to flag. This should prevent user from submitting a form that has missing fields. 

  • Click the data card
  • Select "Required" from the top left Properties dropdown
  • Change from "false" to "true"

Now when user submits form, if the field is blank, it won't allow form to be submitted until user adds a value. 

 

PRO TIP: Don't delete the "error message" and "star" controls from the default data card. It defeats much of the above solution. 

 

Hope this helps. 

hello @v-monli-msft @ericonline @Shanescows@bdodu

 

I am using form which is spanned on 3 screens.

I know that if a form is present on only 1 screen then we can use "Submit form" for the validations.

Right now as my form is on 3 screns and i am using patch function with form1.updates, i am not getting the default validation

 

seadude
Memorable Member
Memorable Member

You might consider creating a single-screen app and controlling the form fields with Visibility instead of having 3 separate screens. I recently did this with an 80+ field form and it works great.

Anonymous
Not applicable

Hi @abd3127 , @Audrie-MSFT 

 

I am really curious on how to make the Validate function work with patching new records...

So, when you wrote 

Validate(DataSource,Item_Being_Updated;Form1.Update)

I have to ask you how did you get the Item_Being_Updated ?

 

I mean, for a creation of a record, I obviously can't write "Lookup(MyDataSource,Id=IdDataCard.Text)"

 

Yhanks for giving me a hand 😉

DavesTechTips
Super User
Super User

Hi @abd3127 

You could consider checking if the forms are valid before submitting. If a card is required but doesn't have a value, the card's value for valid is false which in turn rolls up to the form which will also have a valid of false.

 

EditForm1.Valid

Please check below video that shows how .Valid can be used.

https://youtu.be/7O8HCz37Q0A

 

Dawid van Heerden

Follow on Twitter: @davestechtips

Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1

**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,141)