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

Hiding text field based on drop down

Hello. Im building simple app that is submitting form to a sharepoint. I have a drop down menu(Business Justification UAT) in one card and text box(Business Reason) in other card.  In the drop down menu I have the option: Other (Please specify below). My goal is if the users selects Other(Please specify below) the text box to appear below and allow the user to input the text.  I have managed to find a few posts about this, but for a pity Im not able to make it work properly. The one Im trying to use is:

 

If(Choices([@aovbg].Business_x0020_Justification_x00).Selected.Value="Other (Please Specify below)",true,false)

 

but it gives me an error and is not working.  Also I have tried this:

If(DataCardKey11.Selected.Value="Other (Please specify below)", true,false)

but both give me an error on .Selected.Value-> Invalid use of '.'
Thank you in advance for the help 🙂 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @SectorOMEGA ,

My comment on the control name was because I thought you were referring to the wrong control (which it appears you were).

For the second item, you only need this on the Visible for it to work 

DataCardValue1.Selected.Value="Other(Please specify below)"

as the statement either has a true or false result and this will reflect directly in the Visible property of the control.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

6 REPLIES 6
Eelman
Super User
Super User

@SectorOMEGA 

Try using

... .SelectedItems

instead of

... .Selected.Value

 

The invalid use of '.' means just that, there's a '.' In the wrong place somewhere. If the above doesn't works use the assistance of the built in intellisense to guide your dog notation selection.

WarrenBelz
Super User
Super User

Hi @SectorOMEGA ,

You just need the syntax below in the Visible of the Text box as the true/false resolves itself

DataCardKey11.Selected.Value="Other (Please specify below)"

however the control name you have used sounds like a label, rather than the dropdown.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@Eelman Thank you very much for the info. I have found out I making mistake in the formula and it should look like this(At least to be correct):

 

If(DataCardValue1.Selected.Value="Other(Please specify below)",true,false)

 

The formula is correct but the field is never been displayed 😞 It remains hidden even if I choose the correct statement. 
@WarrenBelz Im a little bit lost with your comment(Dont get me wrong please) but Im fairly new to powerapps matter

I found it. I was missing one space in the declaration. All working fine with this:

If(DataCardValue1.Selected.Value="Other(Please specify below)",true,false)

Thank you both @WarrenBelz and @Eelman 🙂 

Hi @SectorOMEGA ,

My comment on the control name was because I thought you were referring to the wrong control (which it appears you were).

For the second item, you only need this on the Visible for it to work 

DataCardValue1.Selected.Value="Other(Please specify below)"

as the statement either has a true or false result and this will reflect directly in the Visible property of the control.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

@WarrenBelz Now I got you 🙂 Thank you for the explanation and help.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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