cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
praneepradee
Frequent Visitor

Clear Label

 Hey,

I have two error message labels that i want to clear on press of CLEAR button if the error message is displayed.

label.PNG

 

Please help!

 

Thank you.

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
KrishnaV
Super User
Super User

Hi @praneepradee ,

 

It is simple, set the variable with your error message and assign that to label as 
To set the value: UpdateContext({varLblVal:"This is Sample", varLbl2Val:"This is Sample2 Value"});
To clear the value: UpdateContext({varLblVal:"",varLbl2Val:""});
label Values.gif

 

Let me know if you need any further help I am always happy to help 😊

 

Regards,
Krishna
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Hi @praneepradee ,

 

Two error messages are shown by two variables, so you only need to assign blank to two variables when you click the Clear button.

Please try this.

Clear.OnSelect: Set(errorMessage,"");Set(errorMessage1,"")

Hope this helps.

Sik

View solution in original post

5 REPLIES 5
KrishnaV
Super User
Super User

Hi @praneepradee ,

 

It is simple, set the variable with your error message and assign that to label as 
To set the value: UpdateContext({varLblVal:"This is Sample", varLbl2Val:"This is Sample2 Value"});
To clear the value: UpdateContext({varLblVal:"",varLbl2Val:""});
label Values.gif

 

Let me know if you need any further help I am always happy to help 😊

 

Regards,
Krishna
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

v-siky-msft
Community Support
Community Support

Hi @praneepradee ,

 

What is the function of Clear Button? Clear the Error Message, or Clear the Form value or Clear the captcha?

How do you define the errorMessage variable?

 

My though is similar with @KrishnaV , use Variable, but to control the visible of two labels, since the captcha component has only a true/false output.

1. Clear.OnSelect:

UpdateContext({VarVisible:false})

2. Get Quote.OnSelect:

If(Captcha1.CaptchaValidated && IsBlank(errorMessage), <YourPatchCodesHere>, !Captcha1.CaptchaValidated or !IsBlank(errorMessage), UpdateContext({VarVisible:true}))

3. Visible of two Labels:

VarVisible

 

Then, when the error message isn't blank or the captcha isn't correct, if you click the Get Quote button, two error labels show; if you click the Clear button, two error labels become invisible.

Hope this helps.

Sik

KrishnaV
Super User
Super User

Hi,

 

Did you get a chance to try my solution to reset the labels ?

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

Regards,
Krishna


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Sorry for the late reply!

 

Yes i tried out your solution.

 

I need to do the validation and therefore i cant use the UpdateContext.

According to your solution when i press the button i see "This is a sample" and when i press clear button it clears the label.

 

loginpage.PNG

 

I have already set the error message. could you please tell me how to clear the label in this context?

 

Thank you!

 

 

Hi @praneepradee ,

 

Two error messages are shown by two variables, so you only need to assign blank to two variables when you click the Clear button.

Please try this.

Clear.OnSelect: Set(errorMessage,"");Set(errorMessage1,"")

Hope this helps.

Sik

View solution in original post

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,135)