Search code examples
powerappspowerapps-formula

How to show different items (that is based on first dropdown) in the second dropdown after first dropdown is selected in Powerapps?


Below is the sample data: Area Table: enter image description here

Building Table: enter image description here

The two dropdown lists: enter image description here

The desired output I would like to achieve is: If first dropdown item is "EC - Empire Complex" then the second dropdown item will show storey 1 and storey 2.If u see the datatable buildingID = 1 is EC - Empire Complex and so on...


Solution

  • You can create a label and set its visible property to false so it just acts as a place to store a variable and set its Text property to:

    LookUp('Area Table', building = Dropdown1.Selected.Value).buildingID
    

    This should set the label to "1" when the EC- Empire Complex is selected. Make sure that this works and then for your second dropdown you can set Items to:

    Filter('Area Table', buildingID = Label1.Text).storey
    

    I found this link helpful to learn more about finding items in data sources: https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup