cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Correct Way to Reference a Checkbox Variable

 

I am trying to set the Default property of a checkbox (ChkMixTot) to a user selection (set via a global variable (VarLockMix)), otherwise I want to checkbox to be blank. I have the following formula in ChkMixTot.Default:

 

If(VarLockMix<>"",VarLockMix,false)

It appears to be working, but I get a warning saying "expecting a true or flase value. The current value may cause unexpted behavior".

 

What do I need to do to ensure this works properly and avoid any "unexpected beahavior"?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Correct Way to Reference a Checkbox Variable

Hi @AGS94 

Could you show us the code that you're using to Set the VarLockMix variable?

Further to @MarcoM's post, if VarLockMix is a boolean variable, you can set the Default property to VarLockMix. This is because VarLockMix is logically the same as If(VarLockMix, true, false).

View solution in original post

3 REPLIES 3
Highlighted
Advocate I
Advocate I

Re: Correct Way to Reference a Checkbox Variable

Is the VarLockMix a boolean variable? If yes, you could just use the following formula

 

If(VarLockMix, true, false)
Highlighted
Super User
Super User

Re: Correct Way to Reference a Checkbox Variable

Hi @AGS94 

Could you show us the code that you're using to Set the VarLockMix variable?

Further to @MarcoM's post, if VarLockMix is a boolean variable, you can set the Default property to VarLockMix. This is because VarLockMix is logically the same as If(VarLockMix, true, false).

View solution in original post

Highlighted
Resolver I
Resolver I

Re: Correct Way to Reference a Checkbox Variable

 

Perfect! The following got rid of all errors when entered in ChkMixTot.Default:

 

Value(VarLockMix)

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (13,951)