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:
  • 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard