web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Click image hide anoth...
Power Apps
Answered

Click image hide another image

(0) ShareShare
ReportReport
Posted on by 10

Hello

 

I'm quite new to powerapps so this might seem like a really silly question, but I have 2 screens called

 

Screen1

Screen2

 

in screen1 I have an image which is called "visualDemo" and in screen2 I have another image called "imgAction"

 

Both the visualDemo image and imgAction are set to visible, so they can be seen

 

What I want to do is use the "onSelect" field on "imgAction", so when it is clicked, the image "visualDemo" simply becomes invisible

 

I tried adding the following to the "onSelect" field in "imgAction" to

 

 

 

Set(visualDemo;false)

 

 

 

but that produced an error

 

Any ideas?

 

Thanks

Categories:
I have the same question (0)
  • subsguts Profile Picture
    1,259 Moderator on at

    Unless you are in a different country, then the it should be with a comma Set(visualDemo, false)

  • Verified answer
    Pstork1 Profile Picture
    69,599 Most Valuable Professional on at

    If you set VisualDemo false that creates a variable called VisualDemo.  You then need to set the Visible property of the VisualDemo control to VisualDemo.  Then when VisualDemo is set to false the VisualDemo control will disappear.  But I recommend not using the same exact name for the control that you use for the variable.

  • markdev22 Profile Picture
    10 on at

    Sorry that was a typo, I had used a ,

  • markdev22 Profile Picture
    10 on at

    Oh ok @Pstork1 thanks, so I set the name of the variable in the "Visible" property of the image

     

    So could you explain, when I do this, the image seems to become hidden, how can you set the variable name in the "Visible" property of the image, but tell it to make the image visible upon load?

     

    I tried 

     

    VisualDemo = true

     

    but that didnt seem to work

     

    Thanks

  • Pstork1 Profile Picture
    69,599 Most Valuable Professional on at

    Add a Set(VisualDemo, true) in the onVisible property for the screen or the OnStart for the app.  That will set the initial value of the variable to true.  Let me explain what is happening.  Power Apps is a declarative system so you can't manually change object properties at runtime.  But you can change the value of variables.  So you set the variables to the values you want to use and then set the properties to be equal to whatever the variable is.

  • markdev22 Profile Picture
    10 on at

    @Pstork1 thank you sir

  • markdev22 Profile Picture
    10 on at

    @Pstork1 I just tried that, but for some reason the image remains hidden, am I doing something wrong?

     

    By the way, for ease, I renamed "VisualDemo" to "GV"

     

    Thanks in advancegv.JPG

  • Pstork1 Profile Picture
    69,599 Most Valuable Professional on at

    What do you mean it remains hidden?  Setting the variable to true should show the image until Image2 is clicked.  After that it will stay hidden until you do something that sets the variable back to true.  App.OnStart and Screen.OnVisible only run the first time they are encountered when starting the program.  You would need something else to reset the variable to allow the image to appear again.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 335 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 96 Super User 2026 Season 1

Last 30 days Overall leaderboard