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 Apps
Answered

First steps

(0) ShareShare
ReportReport
Posted on by

Hello all.

 

Today I launched power apps for the first time. I have always preferred to learn from a living organism. I decided to start with something simple: I have two objects, the first is a button called "button1", the second is a square called "test". I would like the rectangle to show or hide after pressing the button. I watched some tips on YT, looked for google but I don't know how to do it. Before, I had a little fun with VBA, but I can see that it is completely different here.

Categories:
I have the same question (0)
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Write this code in the relative properties:

     

    Button's OnClick property;

     

    UpdateContext({varShow:!varShow});

     

    Rectangle's Visible Property;

     

    varShow

  • pablik01 Profile Picture
    on at

    great thanks a lot. Could you explain it to me briefly?

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    UpdateContext set up the variable in the context of the screen.

    By default they are boolean and value is false.

    If you write:

    UpdateContext({varShow:!varShow});

     

    Then you are toggling the Boolean value of variable name varShow. When you set this variable in the visible property of another control. You are manipulating that control's visibility based on variable Boolean value.

     

    If it worked out for you please close this thread by clicking Accept as Solution

  • pablik01 Profile Picture
    on at

    one more question, so as not to pose a new topic:
    I launched the applications based on the canvas, I had a choice of a phone or tablet. What if I wanted to create an application that works in a browser on a desktop computer?

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    It will work in both cases. But tablet is better choice since it will be large screen in browser compare to phone

  • pablik01 Profile Picture
    on at

    yes, but is it generally possible to choose what area (size) of the screen I can have, or do I only have these two options?

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    Once you choose that and create app you can change the layout and screensize from inside the app in settings options

  • pablik01 Profile Picture
    on at

    heh, sorry one more question. what if I wanted to add to this button and a square, what if I already have one button and one more square

     

    I promise that this is the last question

  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    I don't understand your question

  • pablik01 Profile Picture
    on at

    now, thanks to your help, I have a button that shows or hides a square to me. I would like to add a second button which also shows or hides but a different figure

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 93 Most Valuable Professional

#2
Haque Profile Picture

Haque 81

#3
Valantis Profile Picture

Valantis 49

Last 30 days Overall leaderboard