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
Super User
Super User

Re: Need help with hiding fields and datacards based on dropdown values

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
Super User

Re: Need help with hiding fields and datacards based on dropdown values

@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.
Super User
Super User

Re: Need help with hiding fields and datacards based on dropdown values

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

Re: Need help with hiding fields and datacards based on dropdown values

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 316 members 5,526 guests
Please welcome our newest community members: