Hide or show field based on another field value

%3CLINGO-SUB%20id%3D%22lingo-sub-36068%22%20slang%3D%22en-US%22%3EHide%20or%20show%20field%20based%20on%20another%20field%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-36068%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20to%20have%20the%20user%20make%20a%20selection%20from%20a%20SP%20choice%20field%2C%20and%20have%20other%20fields%20either%20get%20hidden%20or%20displayed%20based%20on%20that%20selection.%20Is%20this%20scenario%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20user%20selects%20Option%201%20in%20the%20first%20field%2C%20%22Additional%20Text%20entry%20field%201%22%20is%20displayed%2C%20and%20%22Additional%20Text%20entry%20field%202%22%20is%20hidden.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EChoice%20Field%3C%2FP%3E%3CP%3E%26nbsp%3B%20%26nbsp%3BOption%201%3C%2FP%3E%3CP%3E%3CSTRIKE%3E%26nbsp%3B%20%26nbsp%3BOption%202%3C%2FSTRIKE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAdditional%20Text%20entry%20field%201%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRIKE%3EAdditional%20Text%20entry%20field%202%3C%2FSTRIKE%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-36068%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-241514%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20or%20show%20field%20based%20on%20another%20field%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-241514%22%20slang%3D%22en-US%22%3E%3CP%3EBingo!%20Solution%20found%20here%3A%3C%2FP%3E%3CP%3E%3CEM%3EIf(%22triangle%22%20in%20MyListBox.SelectedItems.Value%2C%20true)%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CEM%3Efor%20full%20details%20follow%3A%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.c-sharpcorner.com%2Farticle%2Fusing-listbox-control-in-microsoft-powerapps%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.c-sharpcorner.com%2Farticle%2Fusing-listbox-control-in-microsoft-powerapps%2F%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-241506%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20or%20show%20field%20based%20on%20another%20field%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-241506%22%20slang%3D%22en-US%22%3E%3CP%3EDid%20you%20get%20a%20response%20on%20this%3F%20I%20would%20like%20to%20also%20know%20how%20to%20do%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-154544%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20or%20show%20field%20based%20on%20another%20field%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-154544%22%20slang%3D%22en-US%22%3E%3CP%3EAlong%20this%20same%20line%2C%20I'd%20like%20to%20show%20a%20date%20field%20based%20on%20the%20selection%20of%20an%20item%20from%20a%20choice%20field.%26nbsp%3B%20Works%20perfect%20when%20the%20choice%20field%20only%20allows%201%20choice%20however%2C%20my%20choice%20field%20allows%20multiple%20selections.%20So%20if%20more%20than%20just%20the%20one%20option%20is%20selected%2C%20it%20then%20hides%20the%20other%20field%20I%20want%20to%20show.%3CBR%20%2F%3E%20So%2C%20the%20question%20is%20how%20to%20show%20the%20date%20field%20based%20on%20the%20inclusion%20of%20an%20option%20in%20a%20multiple%20choice%20field.%20So%20far%2C%20I've%20only%20gotten%20it%20to%20work%20when%20the%20option%20is%20the%20last%20item%20chosen.%26nbsp%3B%26nbsp%3B%20Do%20you%20see%20how%20to%20make%20it%20work%20when%20my%20one%20option%20is%20selected%2C%20regardless%20if%20others%20are%20too%3F%3C%2FP%3E%0A%3CP%3EVisible%20property%20of%20Date%20field%3A%20If(DataCardValue4.Selected.Value%20in%20%22Assignment%20Extension%22%2C%20true%2Cfalse)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-36122%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20or%20show%20field%20based%20on%20another%20field%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-36122%22%20slang%3D%22en-US%22%3E%3CP%3EYes.%20You%20will%20just%20need%20to%20add%20a%20condition%20to%20the%20OnVisible%20property%20of%20the%20field%20you%20want%20to%20hide.%20The%20If()%20function%20is%20almost%20the%20same%20as%20the%20one%20in%20Excel.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20would%20look%20something%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETextbox2%20OnVisible%20property%3A%3C%2FP%3E%3CP%3EIf(DropDownOptions.Selected.Value%3D%22Option%201%22%2C%20false%2C%20true)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-670427%22%20slang%3D%22en-US%22%3ERe%3A%20Hide%20or%20show%20field%20based%20on%20another%20field%20value%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-670427%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F185633%22%20target%3D%22_blank%22%3E%40Jose%20Zaldivar%3C%2FA%3E%26nbsp%3BI%20just%20want%20to%20thank%20you%20!!!!%20%3A)%3C%2Fimg%3E%20I%20was%20looking%20for%20this%20solution%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

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

 

 

9 Replies
Highlighted

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)

Highlighted

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)

Highlighted

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

Highlighted

Bingo! Solution found here:

If("triangle" in MyListBox.SelectedItems.Value, true)

for full details follow:

https://www.c-sharpcorner.com/article/using-listbox-control-in-microsoft-powerapps/

Highlighted

@Jose Zaldivar I just want to thank you !!!! :) I was looking for this solution 

Highlighted

@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

 

Highlighted

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

 

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

Highlighted
This method works for "choice" items/data types from sharepoint list