cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cchan000
Helper V
Helper V

beginner question about conditional visibility. please help, driving me mad.

Hi. I am extremely new to PowerApps but trying and eager to learn.
I have a SP list I am editing in Powerapps.
I have a dropdown that has two available choices, Black or White.
When someone chooses Black, I want another data card text box to appear.
In Tree View, when i go into the Black/White choice datacard, i see DataCardValue5 in it.
In the tutorial I learned to changed the visibility of the text box I want to change visibility by using a formula like this:
 
If(DataCardValue2.Value = true, true)
 
so I Tried this:
If(DataCardValue5.Value = Black, true)
 
this didn’t work. What am i doing wrong? I read that I have to find out the dropdown name? I thought it was DataCardValue5.
 
Any help please would be tremendously appreciated.
1 ACCEPTED SOLUTION

Accepted Solutions

Hi @cchan000 ,

DataCardValue5.Value can not be used to represent the drop down's selected item.

I suggest you try this

If(DataCardValue5.Selected.Value="Linear",true,false)

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Pstork1
Dual Super User III
Dual Super User III

The value you are setting in your dropdown is a string.  You have to test it as a string .  Use the following code instead.

If(DataCardValue5.Value = "Black", true,false)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi! Unfortunately it doesn't work.

 

It says Name isn't valid. This identifier isn't recognized.

 

I used black/white as an example, but the drop down selection is actually Linear/NonLinear (which is in the screenshot).

 

Please see attached screenshot.

Hi @cchan000 ,

DataCardValue5.Value can not be used to represent the drop down's selected item.

I suggest you try this

If(DataCardValue5.Selected.Value="Linear",true,false)

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

you a genius. it worked.

one more question please.

 

what if i want it to be visible if a user selects Black or White from the dropdown.

 

the below did not work.

 

If(DataCardValue5.Selected.Value="Black" or "White",true,false)

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,740)