cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Need help with hiding fields and datacards based on dropdown values

Hello everyone, I'm new to both Powerapps and these forums.

 

I need to create a form in wich I'm able to show/hide a text input field based on the value of a drop down.

 

Example:

 

Dropdown1 has the following values (the data source is a list):

 

Health
Insurance
Other

If I select "Other", I need a text input field to appear so the user can submit another area apart from health or insurance.

 

I have tried with multiple variations of this formula, to no avail:

 

If(Dropdown1.Selected.Value="Other", true,false)

 

Powerapps simple tells me that .Value= is not valid. 

 

Can someone help me resolve this? I've trying for 3 days to solve this and created more problems than solutions.

 

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi!

 

To add on to @RandyHayes reply: if you're using a data source with several columns, in the list box you have to specify which column to display and then in the formula which column to compare to. The formula can be written:

 

 

Dropdown1.Selected.ColumnToCompare = "Other"

 

 

For example, I use a data source (list if you like) with the following columns: 

Id Name InsuranceType

 

In the list box I display the name, but I want to use the InsuranceType to compare, hence I use:

 

 

Dropdown1.Selected.InsuranceType = "Other"

 

Hope that helps , good luck!

 

 

 

View solution in original post

3 REPLIES 3
Super User III
Super User III

@Anonymous 

Welcome to PowerApps and to the community forum.

 

So, in general (which I believe you have already come to) you want your text input control to be visible or not based on the value selected in the dropdown.

So, indeed you will be looking at the Visible property of the TextInput control.

In there you should have the following formula:

   (Dropdown1.Selected.Value = "Other")

Although you can put the If part and the true and false in, you don't need it.  The above formula will evaulate to true or false by itself.

 

Now...why would this not work for you?

This is going to depend on the Items property of your DropDown control.  You mention it is from another datasource.  If you are using Distinct to get these values, then the dropdown selection will not have a "Value" property, instead it will have a "Result" property.  So, the above formula would be (Dropdown1.Selected.Result = "Other)

If there are any other formulas you are using to create the dropdown list items, then please share that so that we can explore further if needed.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hi!

 

To add on to @RandyHayes reply: if you're using a data source with several columns, in the list box you have to specify which column to display and then in the formula which column to compare to. The formula can be written:

 

 

Dropdown1.Selected.ColumnToCompare = "Other"

 

 

For example, I use a data source (list if you like) with the following columns: 

Id Name InsuranceType

 

In the list box I display the name, but I want to use the InsuranceType to compare, hence I use:

 

 

Dropdown1.Selected.InsuranceType = "Other"

 

Hope that helps , good luck!

 

 

 

View solution in original post

Anonymous
Not applicable

That's exactly what I needed. Problem was I was referencing the wrong column.

 

Using "Name" solved it. Preoviously I was referencing "Value", which is not present on my list.

 

Thanks!

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,218)