How to Hide Fields Based on Condition in Power Apps [Dropdown]

    Do you want to display value based on dropdown selected in Power Apps? In this Power Apps tutorial, I will explain how to hide fields based on conditions in Power Apps.

    Here, we will discuss the Power Apps visible if the dropdown equals and how to show hide fields based on the Power Apps dropdown selection. Additionally, we will see the Power Apps hide field based on the dropdown control with real examples.

    Power Apps Hide Fields Based on Condition

    Let’s see how to work with the PowerApps hide fields based on the condition with various examples:

    Example-1: PowerApps display value based on dropdown selected

    In the first example, I will show you how to display value based on dropdown selected in Power Apps.

    I have a SharePoint Online list named “Expense Tracker” and this list contains the below fields.

    Column NameData Type
    ItemIt is a default single line of text
    Expense TypeChoice
    BudgetChoice
    Payment DateDate and time
    AmountCurrency

    Refer to the below screenshot:

    powerapps visible if dropdown equals

    In Power Apps, there is a Dropdown control and an Edit form. Now, I would like to view the Budget field on an edit form based on the dropdown value selection [If the dropdown value equals “Personal” then, the budget field will be visible or else it will be in disable mode] as shown below.

    powerapps if dropdown equals

    To work around this, follow the below-mentioned steps. Such as:

    1. Open Power Apps -> Create a Blank Canvas app and connect it to the respective SharePoint list [Expense Tracker] like below.

    powerapps hide field based on dropdown

    2. On the Power Apps Screen -> Insert a Dropdown control and set its Items property to the code below.

    Items = Choices([@'Expense Tracker'].ExpenseType)

    Where,

    • Choices() = This function uses the Choices function to provide a list of choices for your user to select from
    • ‘Expense Tracker’ = SharePoint Online List
    • ExpenseType = SharePoint List Choice Field
    powerapps visible based on dropdown value

    3. Next, insert an Edit form control and set its DataSource property as:

    DataSource = 'Expense Tracker'

    4. To display the SharePoint list fields on the Edit form control, change the Default mode is “New” as in the screenshot below.

    powerapps hide fields based on condition

    5. Once you select the list, all the fields will be added to the form automatically. Before using any fields, you need to unlock the data card first. You can add or remove the unnecessary fields from the edit form. Also, if you want to design the form, you can use properties like Form Color, Field Font Size, Field Font weight, etc.

    6. Now, select the Budget_DataCard1 and set its Visible property to the code below.

    Visible = If(
        drp_ExpenseType.Selected.Value = "Personal",
        true,
        false
    )

    Where,

    • If() = This function is used to evaluate multiple unrelated conditions
    • drp_ExpenseType = Power Apps Dropdown Control Name
    • “Personal” = Value Name
    powerapps display value based on dropdown selected

    Once your app is ready, Save, Publish, and Preview the app. Whenever the user selects the dropdown value as “Personal” then only, the Budget Datacard will be visible or else it will be in disable mode like below.

    powerapps if dropdown value equals

    Example-2: Show/Hide Button Based on Dropdown Value in Power Apps

    In this example, I will show you how to show or hide a button control based on a dropdown value in Power Apps.

    I will also take the above Edit form control [frm_Expenses] for this example. Now, I want to display the Button control based on the Dropdown control value [“Within Budget”] as shown below.

    powerapps display value based on the dropdown selected

    To achieve it, follow the below steps. Such as:

    1. On the Power Apps Screen -> Insert the Button control under the edit form and set its Visible property to the code below.

    Visible = If(
        drp_BudgetValues.Selected.Value = "Within Budget",
        true,
        false
    )

    Where,

    • drp_BudgetValues = Power Apps Dropdown Name
    • “Within Budget” = Dropdown Value
    powerapps visible based on the dropdown value

    2. Now, select the button control and set its OnSelect property as:

    OnSelect = SubmitForm(frm_Expenses)

    Where,

    • SubmitForm() = This SubmitForm() function in the OnSelect property of a Button control to save any changes in a Form control to the data source
    • frm_Expenses = Power Apps Gallery Name
    powerapps hide fields based on a condition

    3. Save, Publish, and Preview the app. If the user selects the dropdown control value as “Within Budget” then, only the button control will be visible, or else it will be in the disable mode like below.

    powerapps hide fields based on the condition

    4. Once the new record is added in the edit form, click on the button control to submit the record into the SharePoint list as in the screenshot below.

    powerapps display value based on dropdown selection

    This is all about the Power Apps hide fields based on the condition.

    Show Hide Fields Based on Power Apps Dropdown Selection

    Here, we will discuss the show/hide fields based on the power apps dropdown selection with a simple scenario:

    Scenario:

    I have a SharePoint Online list, i.e., [“Access Registers“] and this list contains the below fields.

    Column NameData Type
    Employee NameIt is a default single line of text
    Visitors NameA single line of text
    Visitors Contact NumberA single line of text
    DepartmentChoice
    sharepoint show hide list column based on dropdown selection

    In the Department column, I have some choice options, i.e., [IT, HR, FINANCE, ADMIN, MARKETING, PURCHASING, VISITORS].

    Based upon these choice options, I want to show or hide the Employee Name, Visitors Name, and Visitors Contact Number in a Power Apps Edit form.

    When a user selects the Department value as Visitors, then the user can see only the Visitors Name and Visitors Contact Number. At the same time, the Employee Name column should be hidden.

    Refer to the below screenshot:

    Show Hide Fields Based on Power Apps Dropdown Selection

    Also, Once you select any department value (Except “VISITORS”), you can see the “Employee Name” field, as shown in the screenshot below.

    powerapps visible if the dropdown equals

    To achieve it, follow the below steps.

    1. On the Power Apps Screen -> Insert an Edit form and set its Datasource as the respective SharePoint list. The Powerapps Edit form looks like the below screenshot:

    sharepoint show hide column based on dropdown selection

    2. If you want to show the Employee Name field Data card, then select the Data card (Employee Name) and apply the below formula on its Visible property as:

    Visible = If(
        drp_Departments.Selected.Value = "VISITORS",
        false,
        true
    )

    Where,

    • drp_Departments = Power Apps Dropdown Name
    • “VISITORS” = Dropdown Selected Value
    sharepoint show hide columns based on dropdown selection

    3. Similarly, If you want to display the Visitor’s Name and Visitor’s Contact Number Data card, then select the Data cards (Visitor’s Name and Visitor’s Contact Number) and apply the below formula on its Visible property to the code below.

    Visible = Visible = If(
        drp_Departments.Selected.Value = "VISITORS",
        true,
        false
    )
    sharepoint show hide columns based on a dropdown selection

    4. Save, Publish, and Preview the app. Once you select any department value (Except VISITORS), you can see the “Employee Name” field, as shown in the screenshot below.

    powerapps app if dropdown value equals

    5. Similarly, Select the Department value as “VISITORS“. At the same time, you can see the “Visitors Name” and “Visitors Contact Number” fields as in the below screenshot.

    powerapps field visible if dropdown equals

    This is all about the SharePoint show/hide list column based on dropdown selection.

    Conclusion

    This Microsoft Power Apps tutorial taught us all the information about the Power Apps hide fields based on the condition.

    Here, we discussed the Power Apps visible if the dropdown equals and how to show hide fields based on the Power Apps dropdown selection. In the last, we also covered the Power Apps hide field based on the dropdown control with a simple example.

    You may also like:

    comment_count comments
    Oldest
    Newest
    Oldest

    Comment as a guest:

    >