cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Error using updatecontext

So basically I want to make a field visible when a field is empty. The following code is inside of my button at OnSelect: 

If(IsBlank(DataCardValue22.Text); UpdateContext({VarError:true}) 

Now on the Visible of my errormessage label I have this: 

VarError

But this gives me an error. What am I doing wrong? 

1 ACCEPTED SOLUTION

Accepted Solutions

Okay now I understood

If(IsBlank(DataCardValue22.Text), UpdateContext({VarError:true}),UpdateContext({VarError:false})  )

give like this 

 

In screen on visible property  add code as 

UpdateContext({VarError:false})

View solution in original post

8 REPLIES 8
mdevaney
Super User
Super User

@Anonymous 
Can you please supply a screenshot of the error message you are receiving in the Visible of your errormessage label?

 

---
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."

Anonymous
Not applicable

Anonymous
Not applicable

Anyone knows a fix?

SumanKoduri
Helper V
Helper V

 

 

If(IsBlank(DataCardValue22.Text); UpdateContext({VarError:true}) 

 

 

Yes, your code should be like this 

 

 

If(IsBlank(DataCardValue22.Text), UpdateContext({VarError:true}) )

 

 

But this VarError variable will get value only when you click that data card so it's better to write your condition in error message 14 label visible property add code as IsBlank(DataCardValue22.Text)

test.PNG

In error message Add some text to check whether it shows message when that data card value is empty

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Anonymous
Not applicable

Sorry, I did not explain what I wanted in my application. I do not want the error message to be always visible if that datacard is empty. I only want it to give the error when they click on the "Submit" button of the form. That's why I've used that code. 

@SumanKoduri 

Okay now I understood

If(IsBlank(DataCardValue22.Text), UpdateContext({VarError:true}),UpdateContext({VarError:false})  )

give like this 

 

In screen on visible property  add code as 

UpdateContext({VarError:false})

Is it fixed or you have any issue still

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Anonymous
Not applicable

All good! Thanks so much!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,687)