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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard