Forum Discussion

Oliver Bartholdson's avatar
Oliver Bartholdson
Brass Contributor
Dec 16, 2016

Hide or show field based on another field value

I would like to have the user make a selection from a SP choice field, and have other fields either get hidden or displayed based on that selection. Is this scenario possible?

 

When user selects Option 1 in the first field, "Additional Text entry field 1" is displayed, and "Additional Text entry field 2" is hidden. 

 

Choice Field

   Option 1

   Option 2

 

Additional Text entry field 1

 

Additional Text entry field 2

 

 

  • Audrie Gordon's avatar
    Audrie Gordon
    Brass Contributor

    Yes. You will just need to add a condition to the OnVisible property of the field you want to hide. The If() function is almost the same as the one in Excel.

     

    It would look something like this:

     

    Textbox2 OnVisible property:

    If(DropDownOptions.Selected.Value="Option 1", false, true)

    • Joseph Collins's avatar
      Joseph Collins
      Brass Contributor

      Along this same line, I'd like to show a date field based on the selection of an item from a choice field.  Works perfect when the choice field only allows 1 choice however, my choice field allows multiple selections. So if more than just the one option is selected, it then hides the other field I want to show.
      So, the question is how to show the date field based on the inclusion of an option in a multiple choice field. So far, I've only gotten it to work when the option is the last item chosen.   Do you see how to make it work when my one option is selected, regardless if others are too?

      Visible property of Date field: If(DataCardValue4.Selected.Value in "Assignment Extension", true,false)

      • Jose Zaldivar's avatar
        Jose Zaldivar
        Brass Contributor

        Did you get a response on this? I would like to also know how to do this.

    • kthayer's avatar
      kthayer
      Copper Contributor

      Audrie Gordon it's been 4 years since this post and I'm hoping you can help me decipher with the latest PowerApps version as of today. I'm trying to decipher between field names and DataCard names. I have the following details where I want the Previous Version Exam Location card to display when the Update value is selected in the New or Update Course card field (Note: This is all pulling from a SharePoint list).

      DataSource: [@'Exam Question Requests']

      DataField: "New_x0020_or_x0020_Update_x0020_"

      Card name (item in condition): New or Update Course_DataCard1_2

      Card name (item to be invisible until condition is met): Previous Version Exam Location (Shared Drive Path)_DataCard1_2

       

      Here's the condition I tried on the Visible attribute for the Previous Version Exam Location card and it doesn't work. I'm not a developer, so trying to get the exact correct condition example:


      If(Choices([@'Exam Question Requests'].New_x0020_or_x0020_Update_x0020_).Value="Update", true, false)

       

      Thanks for any tips.

      Kris

       

      • kthayer's avatar
        kthayer
        Copper Contributor

        kthayer  Okay, I finally found a direct answer in another blog as follows:

         

        If(DataCardValue4_2.Selected.Value = "Update", true, false)

Resources