cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Shibato
Level: Powered On

Cascading dropdown based on other list

Hi Guys,

I need some help with cascading dropdown list in PowerApps.

 

I have 3 lists:

  • NewEmployeeForm_Departments
    where I have only one Title column with departments description
  • NewEmployeeForm_Positions
    where I have one title column with job positions description and one lookup column connected with departments list
  • NewEmployeeForm
    many different columns and two lookup columns connected to departments and positions lists

I've prepared PowerApps form to third list, but unfortunately I'm not able to filter positions based on departments.

 

I tried two following scenarios:


  1. Department
    Choices(NewEmployeeForm.Department)
    Position
    Sort(Distinct(Filter(NewEmployeeForm_Positions;Department=DataCardValue2.Selected.Value);Title);Result)

    And this works fine - filter works. Unfortunately when I submitting the form Position column is empty. And it makes sense, because I am referring to the different list (NewEmployeeForm_Positions)

  2. Department
    Choices(NewEmployeeForm.Department)
    Position
    I tried with something like below, but probably it isn't good approach:
    Filter(Choices(NewEmployeeForm.Position);Department.Value=DataCardValue2.Selected.Value in NewEmployeeForm_Positions.Department)

    Could you Guys point me to correct way to achive that goal?
    Many thanks. 
1 ACCEPTED SOLUTION

Accepted Solutions
egallis
Level 10

Re: Cascading dropdown based on other list

Hi @Shibato,

If I understand your situation:

  • NewEmployeeForm_Departements
    • Title
  • NewEmployeeForm_Positions
    • Title
    • Department (lookup to Departments)
  • NewEmployeeForm
    • many columns
    • Departement (lookup to Departements)
    • Position (lookup to Positions)

In you form for the NewEmployeeForm list, once you have chosen a value for the Department field, you want to filter the list of values in the Position field according to the Departement field value.

If that's what you want to achieve, here is how you have to do it... In the Items property of your Position field, put the following code:

Filter(
Choices(NewEmployeeForm.Position),
Id in ShowColumns(
Filter(NewEmployeeForm_Positions, Department.Id=DataCardValue2.Selected.Id),
"ID"
)
)

Tell us if this works for you...

Emmanuel

 

3 REPLIES 3
Super User
Super User

Re: Cascading dropdown based on other list

 Take a look at Shane Young's video on cascading dropdowns which will take you step by step through the process - https://www.youtube.com/watch?v=pkZG2boN7jQ

egallis
Level 10

Re: Cascading dropdown based on other list

Hi @Shibato,

If I understand your situation:

  • NewEmployeeForm_Departements
    • Title
  • NewEmployeeForm_Positions
    • Title
    • Department (lookup to Departments)
  • NewEmployeeForm
    • many columns
    • Departement (lookup to Departements)
    • Position (lookup to Positions)

In you form for the NewEmployeeForm list, once you have chosen a value for the Department field, you want to filter the list of values in the Position field according to the Departement field value.

If that's what you want to achieve, here is how you have to do it... In the Items property of your Position field, put the following code:

Filter(
Choices(NewEmployeeForm.Position),
Id in ShowColumns(
Filter(NewEmployeeForm_Positions, Department.Id=DataCardValue2.Selected.Id),
"ID"
)
)

Tell us if this works for you...

Emmanuel

 

Shibato
Level: Powered On

Re: Cascading dropdown based on other list

Hi Guys,

@egallis your solution works perfect. Big thanks for your help Smiley Happy

@LRVinNC thanks for your suggestion.

 

Have a great day. 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 35 members 4,297 guests
Please welcome our newest community members: