Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / Context Variable for V...
Building Power Apps
Answered

Context Variable for Visibility not working

Posted on by 329
I am trying to control visibility with a context variable. It doesn't seem to be working when I add the variable to the variable's visibility, it disappears and will not show even though the value is set to true. 
 
 
What it should look like
 
 
Creating the context variable 
 
 
using the variable 
 
 
Changing variable if condition is met. 
 
Categories:
  • Verified answer
    Trout19 Profile Picture
    Trout19 329 on at
    Context Variable for Visibility not working
    I figured it out. The variable was empty so i ran the app and the variable populated with true, and it started working.
  • Trout19 Profile Picture
    Trout19 329 on at
    Context Variable for Visibility not working
    Ok, so he is my thought process. I have several sections that I would like to have the visibility set to hidden, but if a condition is met set the visibility to show and it will stay shown for the rest of the form's life. 
     
    When I created the context variable, I set it to true for testing purposes. So, when the context variable is true it should be showing and when it is false it should be hidden. 
     
    The first photo I sent is what it looks like before a context variable is made and just has true in the visibility section.
     
    The changing will be done in the switch statement, going from false to true. And stay true
  • CA1105 Profile Picture
    CA1105 182 on at
    Context Variable for Visibility not working
    Where is your code to hide that percituler section? Any you share more information what should be happen and when it should?
  • Suggested answer
    FLMike Profile Picture
    FLMike 26,162 on at
    Context Variable for Visibility not working
    Hi,
     
    its very hard to see what you pasted in, so I am going to ask
     
    I see in the OnVisible, you set it to true, but after that, when it goes invisible, how does it come back?
     
    So if you stay on the screen, and you do something that sets it to false, what sets it back?
     
    That's what I think is missing.
     
    Please mark if this is the answer.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,065

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,407

Leaderboard