Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

problem with OnVisible screen property boolean evaluation

(0) ShareShare
ReportReport
Posted on by

I'm confused about what is going on here.  I was introduced to UpdateContext()

 

I have a screen CREATE, in this screen's OnVisible I have 
UpdateContext({TitleDisplayDisabled: true, TopicAnalysisMinimize: true})

I want to hide a form with var TopicAnalysisMinimize.  So I go into this form Visible property and tried these two evals
Visible = TopicAnalysisMinimize; assuming this would work as var TopicAnalysisMinimize is true right now)
Visble = If(TopicAnalysisMinimize, true, false); assuming this would work as TopicAnalysisMinimize is true

HOWEVER,
If I revert my second to: If(TopicAnalysisMinimize, false, true); This actually works and my forms is hidden

I do not understand what is going on, if TopicAnalysisMinimize is true then my first argument in the If should be evaluated?


Categories:
  • STS1SS Profile Picture
    293 on at
    Re: problem with OnVisible screen property boolean evaluation

    Ill start at the end.

     

    Your IF says if the variable TopicAnalysisMinimize is TRUE, make the form NOT VISIBLE.

     

    The first thing is working too... you set TopicAnalysisMinimize to TRUE, then set the fomr as VISIBLE if that variable is TRUE.

     

    Looks like they are both working.

     

    If you want the form hidden at the start, then just use the second formula.

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at
    Re: problem with OnVisible screen property boolean evaluation

    For the visible property all that is needed is a true or false state. When using boolean variables you can simply have the variable name as the only thing in the property. If you just put TopicAnalysisMinimize in the visible property, the item will be visible if that variable is true and ill not show when it is false. You can use !TopicAnalysisMinimize to reverse that logic

  • LaurensM Profile Picture
    12,510 Super User 2025 Season 1 on at
    Re: problem with OnVisible screen property boolean evaluation

    Hi @gstlouis,

     

    I may be misunderstanding the issue, but you would like to hide the Forms when the variable is set to true. Is this correct?

     

    The Visible property expects either true or false to indicate visibility. True being visible and false being hidden.

     

    Your first 2 code examples both return true and will result in the form being visible. The third example, however, will result in false making the form hidden.

    If(
     Condition returning true/false,
     If true then run this code...,
     If false then run this code...
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,594 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,928 Most Valuable Professional

Leaderboard