web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help showing/hidi...
Power Apps
Answered

Need help showing/hiding a text box based on value of dropdown

(0) ShareShare
ReportReport
Posted on by 67

I'm trying to show/hide a text box in a form depending on the value selected in a dropdown box.

 

The code I am using in the Visible property of the text box is:

If(Type_x0020_of_x0020_Event.Value="Other",true,false)

So if the user has selected Other then the text box shows. However the text box never shows and when I pass the dropdown value to another label it is always showing as the first option in the dropdown and not the actual option that has been selected.

 

Any ideas what I am doing wrong? Thanks

Categories:
  • Sienna Profile Picture
    1,532 on at

    Hi

    What type of database you use in the dropdown (excel, sharepoint)? What is the name of it (I assume "Type_x0020_of_x0020_Event")? What structure is the database (columns names, type)?

     

    If your database is in excel and columns

    ID              Name

    1               Option1

    2               Option3

     

    Then use code in the text box in visible property

     

    DropDown1.Selected.ID=1

     

    and the textbox will be visible when Option1 is selected

  • Daveed1973 Profile Picture
    67 on at

    Hi Sienna,

     

    It's a Sharepoint list and the field itself is a simple Choice field with the values typed into the list. The choices are displayed by using a drop-down menu.

     

    The column name is "Type of Event" and the choices are:

    Clinical Trial
    Demonstration
    Exhibition
    Product Evaluation
    Other

     

    I don't seem to get an option for Selected.ID but I'm guessing that is because it isn't coming from Excel.

  • Sienna Profile Picture
    1,532 on at

    Oh boy... I was hoping for not sharepoint... 🙂

     

    try then

     

    DropDown1.Selected.Value="Other"

     

    Obviously change DropDown1 with the name of your dropdown

     

    But just because it is sharepoint I'm not sure because I'm not working with sharepoint and hopefully never will

  • Daveed1973 Profile Picture
    67 on at

    Unfortunately not, just get an "Invalid Argument Type" error when I add the Selected parameter to it.

  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    The visible property can't be directly set by referencing another field. You can use a variable in the visible property of your text box and then use the OnChange event of the dropdown to update the variable to the appropriate value (true of false).

  • Sienna Profile Picture
    1,532 on at

    @Daveed1973

    Any chance to give us some picture and detailed description what exactly are you trying to accomplish?

  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    @Daveed1973

     

    I've just tested this with a SharePoint choice field and I was able to make this work with syntax that resembles:

     

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

    I didn't get any "Invalid Argument Type" errors. Perhaps you could look at this screenshot and see if there's anything obviously differently between what you're doing, and what I'm doing?

     

    SPChoiceList.PNG 

  • Daveed1973 Profile Picture
    67 on at

    @timl

     

    Unfortunately that doesn't work for me still. See attached image.

    2018-01-22.png

  • Daveed1973 Profile Picture
    67 on at

    Not sure what Iong here but I can't seem to get any of this to work. I cannot use the "Selected" option as it gives me an "invalid name" error.

     

     

    In the Type of Event drop down list I have set the OnChange value to:

    Set(VarTypeOfEvent,Type_x0020_of_x0020_Event.Value)

    Then, just to ensure that this is working correctly I have created a label and have set the text value to the varible VarTypeOfEvent as set in the OnChange property from above.

     

    Using a variable works but for some reason it only ever gives me the first value in the drop down list which is "Clinical Trial" rather than the value which is being selected.

     

     

  • Verified answer
    timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    Hi @Daveed1973

     

    Apologies, I probably wasn't too clear in my reply.

     

    The syntax that works is this:

    If([NameOfDropDownControl].Selected.Value="Other",true,false)

     

    For example, here's the syntax from the highlighted part of my screenshot:

    If([DataCardValue10].Selected.Value="Other",true,false)

     

    In your case, you would need to replace [DataCardValue10] with the name of your dropdown. You can find out the name by clicking the dropdown in your 'Type of Event' card and looking in the properties pane.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard