cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
myonlywan
Helper I
Helper I

Fields visibility based on checkbox

I am new to Powerapps and trying to use checkbox, example if yes was checked, the field more comments will appear, if user click no, the field will not be visible.

Any idea how i can do that? Thank you.

9 REPLIES 9
Drrickryp
Super User II
Super User II

You could use the OnCheck property of the checkbox to make a context variable: UpdateContext({vis:true}) and the OnUncheck property to UpdateContext({vis:false}) and set the Visitbie property of the Field to that context variable. vis.  To toggle the visibility set the OnSelect property to UpdateContext({vis:!vis}).  Hope this helps.

hihi...i tried and the box for comments did appear after checking the box but the box disappeared when i tried to key in the comments?

Why was it so

@myonlywan

@Drrickryp recommended solution should work - see the screenshots attached to see if you can make it work for you.

thanks, i tried and it seem working now, The only funny thing is when you try to add record, the comments field doesnt appear but when you try or refresh, it works.Smiley Embarassed

Set the variable to be visible OnStart or OnVisible of the app opening.

myonlywan
Helper I
Helper I

Where can I locate the onstart or onvisible?

Select the first screen in your app.  When your screen is selected, Click the dropdown arrow under the File menu bar and you will see OnStart, OnVisible.

Whatever formulas you put in OnStart will not be effective in the browser unless you Save and Close the app.  For testing purposes, it is a good practice to put you OnStart commands in a button and set the OnSelect formula to the same actions.  This allows you to test the OnStart formulas without requiring you to continually close and re-open your app.  

If your open to suggestions, I'd recommend that you watch some of the videos by:

Audrie Gordon (Friday Functions) 

Mr. Dang 

Shane Young 

They have excellent tutorials that really will help you as you learn the tool.  

Thanks for the great info...It worksSmiley LOL

Glad to hear. Please be sure to mark this one as solved.  And good luck!

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (49,533)