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

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 III
Super User III

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

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.

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})

View solution in original post

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.

 

All good! Thanks so much!

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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

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