cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tagustin2020
Post Prodigy
Post Prodigy

Data Card Conditional Visibility

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

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 

View solution in original post

3 REPLIES 3
Michael_Scott
Regular Visitor

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!

v-qiaqi-msft
Community Support
Community Support

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 

View solution in original post

@v-qiaqi-msft 

@Michael_Scott 

 

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

 

Teresa

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (47,783)