Show or hide fields based on choice values in Power Apps

This post describes how to show or hide fields based on a choice column from a SharePoint list in Power Apps.

I was recently working on a Power App form for new site/ teams requests. The fields were all based on SharePoint list columns and one of the key fields was a choice column. What I wanted to do was have an additional field default to being hidden from the screen unless a particular choice value was selected.

Now I’ve used the Microsoft guidance to create dependant drop-downs before but this scenario was slightly different and it was based on a choice column which isn’t compatible to my knowledge. I’d done something before in my Power App to toggle the display mode of a button in my app if fields are blank. So starting with this I used a simple if function in my formula to show/ hide my field based on the selected choice value.

Solution

Here’s how to hide a field based on a choice value in Power Apps:

  • Open your Power App to edit it > ensure both the choice field and the field you want to hide are added to the screen
In this example, a drop-down list will be hidden by default until project site is selected from within the request type choice field.
  • Select the data card for the field you want to hide until a choice value is selected
  • In the top, left-hand corner of the Power Apps editor, select the visible property
Select the Visible property when selecting the hidden field in your PowerApp.
  • Add the following if statement to the formula bar, replacing the parts highlighted below:

If(rdoRequestType.Selected.Value="Project site",true,false)

  • Replace rdoRequestType with the name of your choice control
  • Replace “Project site” with the selected value from your choice field

Now, by default your field will be hidden from the screen until you select the relevant choice value!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s