I’m working on digitizing a form to improve the user experience and our data collection and availability efforts. I decided to do this one in PowerApps as we begin to pivot organizationally toward the modern experience.
During building this particular form, I needed to hide fields unless the user indicated “Yes” to corresponding dropdown fields. Here’s the end-result:

To get this to work we have to do three steps:
- Initialize variables for visibility
- Set the conditional fields’ visibility to the new variables
- Set the dropdown to toggle the related variable
Initialize variables for visibility
First we need to tell our app that we’ll be using true/false variables to indicate the visibility of our conditional fields. We do this from the OnVisible property (2) of the Form Screen (1).

The formula itself should be as follows (3). Use a semi-colon between each UpdateContext function to add additional variables. I’m using aVisible, bVisible, etc.
UpdateContext({aVisible: false});UpdateContext({bVisible: false});UpdateContext({cVisible: false})
So in your documentation you might note something like:
Variable | Default state | Changed by | Hides/Shows |
aVisible | false (hidden) | BAARequired (dropdown) | BAAEffectiveDate |
bVisible | false (hidden) | ConflictsOfInterest (dropdown) | Conflicts…Completed |
cVisible | false (hidden) | DataSecurityRisk (dropdown) | DataSec…Completed |
Note: You can use the same variable more than once to show/hide multiple fields based on one dropdown.
Set the conditional fields’ visibility to the new variables
Now we need to assign these variables to the DataCards for each field we wish to hide.
From the Tree View panel, select the DataCard (not the DataCardValue within/beneath it) for the field you wish to hide (1). Then go to its Visible property (2). Finally, set the property’s function to the variable you initialized for it (3). In this example I decided I would use “cVisible” for “DataSecurityRiskCompleted”.

Repeat the steps above, assigning variables to each field you want to hide until a dropdown is changed to the triggering value.
Set the dropdown to toggle the related variable
The last step is to tell the variables we established to change based on a dropdown.
First select the DataCardValue (not the DataCard) within the data card (1).
Then select the OnChange property (2) and set the function to the following (3):
Switch(DataCardValue46.Selected.Value,"Yes",UpdateContext({cVisible: true}),UpdateContext({cVisible: false}))

Repeat for each dropdown that should serve as a trigger for conditional fields. Now, when I publish my app, changing “Data Security Risk” to “Yes” will change the default false visibility of DataSecurityRiskCompleted to true. If I change the dropdown to “No” again, it will hide the related field again.
