Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Context Variable for Visibility not working

Like (1) ShareShare
ReportReport
Posted on 12 Sep 2024 19:32:08 by 359
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 359 on 13 Sep 2024 at 14:52:28
    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 359 on 13 Sep 2024 at 13:17:30
    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 222 on 13 Sep 2024 at 09:13:39
    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 29,371 on 13 Sep 2024 at 00:50:56
    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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,316

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,290

Leaderboard
Loading started