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 Platform Community / Forums / Power Apps / Data Card Conditional ...
Power Apps
Answered

Data Card Conditional Visibility

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have certain data cards that I wish only to appear if certain project types are chosen from a dropdown control (to confirm, it is not a combobox control). To achieve this, I renamed the data card value vPrefixType and then changed the Visible property of the data cards to vPrefixType.Selected.Value = "110-Name of Program" || "650-Name of Program

 

PrefixSS.png

 

When 110 is selected, all of the correct data cards appear. When 650 is selected, they do not appear. I’m sure it is probably a simple syntax adjustment. Your advice would be appreciated. Thank you. Teresa

 

Categories:
I have the same question (0)
  • Michael_Scott Profile Picture
    106 on at

    So in PowerApps you cant set variables like you do writing code with python, java, c, etc. In those languages you would do like you did and say:

    varName = value;

    In PowerApps you have to use either the Set(varName, value) function or the UpdateContext({varName: value});

    In your case you might try setting/adding to the onVisable property of that screen and adding the UpdateContext method to set your variable. This will make that a local variable to that screen and that screen alone. If you use the variable on multiple screens you can use a set function call on app load and then you can see it from any screen in the app. Once you have decided which works better for your case, (global or local vars) then then the next step is to write your statement to decide when to make something visible. I generally use an If(condition, ifTrueValue, ifFalseValue) function. So something like If(vPrefixType.Selected.Value = "110-Name of Program" Or "650-Name of Program", true, false). So If the selected value is one of those 2 strings visibility is true else its false. Not sure if I explained too much but hope it helped! Happy Power Apping!

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@tagustin2020,

    Please try to modify your formula as below:

     

    vPrefixType.Selected.Value = "110-Name of Program" || vPrefixType.Selected.Value = "650-Name of Program"
     

     

    Hope it could help.

    Regards,

    Qi 

  • tagustin2020 Profile Picture
    on at

    @v-qiaqi-msft 

    @Michael_Scott 

     

    Thank you both for responding. Qi's formula adjustment worked. Have a great day!

     

    Teresa

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 531 Most Valuable Professional

#2
Haque Profile Picture

Haque 261

#3
Kalathiya Profile Picture

Kalathiya 221 Super User 2026 Season 1

Last 30 days Overall leaderboard