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

And operator issue

(0) ShareShare
ReportReport
Posted on by 42

Hello everyone, 

I´m new to Power App and I´m struggling with an operator. 

In general I have two different screens. They are connected via buttons and the second screen has a form with several cards.

My goal is to make a specific card of the screen 2 visible when the button of the screen one is pressed AND a second button from the screen two is pressed. 

I used this formula on ´Visibile´ section of the card:

 

And(varListSection="Button name from screen 1" , varListSection="Button name from screen 2", true)

 

 The condition must be valid for both buttons; only if I press both the card will be visible. 

So far I got no result, the card is not visible at all. 

 

Thank you in advance for your help 🙂

Categories:
I have the same question (0)
  • Verified answer
    BCLS776 Profile Picture
    8,994 Moderator on at

    This will work better if you use some variables:

     

    In the OnSelect property of Button 1 put:

    UpdateContext({varButton1Pressed: !varButton1Pressed});

    Similarly, in the OnSelect property of Button 2 put:

    UpdateContext({varButton2Pressed: !varButton2Pressed});

    Then, in the Visible property of the card put:

    varButton1Pressed && varButton2Pressed

    Hope that helps,

    Bryan

     

  • BCLS776 Profile Picture
    8,994 Moderator on at

    Note, the variables above will work if the buttons and card are all on the same screen. If not, use the Set() function to use a global variable, rather than UpdateContext()

  • madlad Profile Picture
    2,637 Moderator on at

    Hi! Buttons by themselves don't return any value. You can reference when they're selected using ButtonName.Pressed, but that only is true for a brief moment when you press them.

    I suspect your best bet here, is to set a variable when each of these are pressed. Perhaps something like :

     

    Set(*ThisButtonName*Pressed, true);

     

     

    Then, for your And(), just try something like:

     

    And(*Button1*Pressed, *Button2*Pressed)

     

     

    Just make sure the variables match whatever you decide to set in your buttons OnSelects - each button will need a variable.(Here I dubbed them "Button1Pressed" and "Button2Pressed")

     

    Hope this helps!

  • mtere Profile Picture
    42 on at

    Hello,

    I used 'UpdateContext' and 'Set' and they both don´t work. 

    When I used UpdateContext I had the buttons on the same screen of the form. 

    Can you please explain what´s the purpose of these functions?

    Thank you 🙂

     

  • BCLS776 Profile Picture
    8,994 Moderator on at

    UpdateContext() creates/updates a context variable that is available to that screen only, while Set() creates/updates a global variable that is available throughout the app. Make sure you don't use the same variable name for global and context variables, or you'll end up with issues

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard