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 Platform Community / Forums / Power Apps / Show DataCard when Gal...
Power Apps
Unanswered

Show DataCard when Gallery Item is selected

(0) ShareShare
ReportReport
Posted on by 5

Good day all,

I have a question for the PowerApps visible field. I want the form datacards on my second screen to be visible only when the selected gallery item on Screen 1 relates to that datacard on Screen 2. I want the relationship to be indicated by a “request type” (Ex: Account Service, Network Service, etc.). I cannot seem to get a formula to work. Here is more info:

 

1. Screen1: contains a Gallery (This gallery’s items populate from a table within the items field)
2. Screen2: contains a Form (Connection: SharePoint List)
3. Request Type: Hardware, Account, Network, Phone, SharePoint, Software
4. Formula Used: If(datacard.text = Gallery.RequestType, True, False)
5. My SharePoint List has over 50 columns (some datacards will only be visible based on another datacard’s value.

 

What is the best way to achieve this result? Should I set variables for this? Like: If(Argument, true, Set(aVariable))

 

What do you recommend? Thank you for your time and assistance.

 

I hope my question is easy to understand, but if you have questions please ask.

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

    @NRFOSTER21 

    You rarely if ever need to use an If() statement with the visible property.  If you set up a radio control with the Items:

    ["Hardware"," Account", "Network", "Phone","SharePoint", "Software"] then set the visible property of each card to 

    Radio1.Selected.Value="Hardware" or Radio1.Selected.Value="Account", etc depending on which request type you want.  If you want some of the cards to be visible for more than one type, you can use something like

    Or(Radio1.Selected.Value="Hardware",Radio1.Selected.Value="Software",Radio1.Selected.Value="Network") in any combination you wish as the Visible property of a card.  You can substitute a dropdown control for the radio control in the description above.  The reason the If() isn't necessary is that the equations above all reduce to either true or false. 

  • NRFOSTER21 Profile Picture
    5 on at

    @Drrickryp 
    Thank you for your timely response! That does make sense for the visibility field, I would essentially be saying the same thing if I just removed the if() statement. Thank you for clarifying that.

     

    Onto the radio/dropdown controls for screen1, I have not planned to use either of that within the gallery itself. To elaborate more on how this gallery has been set up, I have a table that depicts item values, and icons which allow the gallery to take the image of a button which the User can select.

     

    If what I understand is right, you’re saying the scenario, for which is described in your previous response, only allows for a radio or dropdown/choice control. On screen1 for the Gallery Item, would It be possible to then use:

    Switch(ThisItem.Selected.Value, “Account”, Set(aVariable, 1), “Network”, Set(aVariable, 2), “Hardware”, Set(aVariable, 3))

    Then on Screen2 within a specific DataCard’s visible field use:

    aVariable = 1 ?

    Unfortunately, I am not able to test this at the moment, so I resulted to inquiring about this on the forum. 

    Thank you for your time and assistance.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @NRFOSTER21 

    Even simpler,

    Gallery1.Selected.'request type'="Account" as the visible property of the card.

    No need for Switch or variables. I'm a minimalist!

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