cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
muralikrishna12
Helper V
Helper V

How to validate(error message) fields, when only button trigger

Hi Mates,

 

I just entered a custom message(error message to title) instead of Parent.Error, this text has to display(If empty) when the User is submitting only, but it's always displaying when entering in to screen.

 

Any assistance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@muralikrishna12 

Sorry for the delay - did I answer this question in the other post you had?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

6 REPLIES 6
RandyHayes
Super User
Super User

@muralikrishna12 

An option...

In the formula for your submitForm, set the following:

UpdateContext({lclShowErrors:!yourForm.Valid});
If(yourForm.Valid, SubmitForm(yourForm))

Now, set the Visible properties of your error messages to: lclShowErrors

 

Errors will not show until someone tries to submit the form.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes ,

Can you please understand the issue here

First, I make it Required DataCard. 

Text property of Error Message is (Default: Parent. Error) is updated with a custom message like"Required"

Visible: Defalut is Parent.DisplayMode=DisplayMode.Edit
Updated with "And(!Parent.Valid, Parent.DisplayMode=DisplayMode.Edit)"

muralikrishna12_0-1609925492514.png

Now when I enter this form its shows a custom message, it should not display until press the button.

It should display if it is empty during submittion.

 

 

@RandyHayes 

Where do I need to Set the following on Form if yes under what property (Visible, OnSuccess, etc)
If Screen what property (OnVisible) etc

UpdateConte

 

UpdateContext({lclShowErrors:!yourForm.Valid});
If(yourForm.Valid, SubmitForm(yourForm))

 

 In this case, where can I enter my custom text Like ("Field is Required") to lclShowErrors so that it will display if the form is not valid  

Please explain a bit clearly 

Hi,

 

Could you please set Error Control Text Property like this : If(!IsBlank(Parent.Error),"Required",Blank())

RandyHayes
Super User
Super User

@muralikrishna12 

Sorry for the delay - did I answer this question in the other post you had?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes ,

Yes, you are right,

The same resolution I got from one of my friends, but in fact, both are the same.
Expecting in future Reply clearly like on-screen of On Visible property update/Set etc.. so that will clearly will clear to every one.

Appreciated your Fix.

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

<
Users online (4,397)