cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Filter a lookup field based on another list columns

hi guys,

 

my 2 lists used for my app are :

Reservation { Name, Registration Number(LookUp Field), Destination }

Vehicules { Registration Number, Brand, Status(availability) }

 

i want to filter the displayed choices of the registration number lookUp field based on the availability of the vehicule (the status field),

is it possible to do this ?

and if so what should i do ?

 

thank you in advance.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Microsoft
Microsoft

Re: Filter a lookup field based on another list columns

Hi medBrami,

 

Can you take some screenshots of the controls and their formulas?

You can also break the formula up to see which parts work and which don't separately, before stringing it all together - so;

 

use this on the Items: property of a dropdown;

Filter(Vehicules, Status="Available").RegistrationNumber

or just 

Filter(Vehicules, Status="Available")

and set the Field: property of the dropdown control to RegistrationNumber

 

If this returns the expected result, then move onto the next piece and so forth.  Test each piece separately and perhaps we can find where it's breaking down.

You can also post some screenshots that show the controls and formula's and perhaps any errors and we can try resolve from there.

 

 

Kind regards,


RT

View solution in original post

4 REPLIES 4
Highlighted
Microsoft
Microsoft

Re: Filter a lookup field based on another list columns

Hi medBrahmi,

 

By the looks of it, the common key between the two lists is the registration number.

You could do this by filtering the Choices/DropDown control in the Reservation form.

 

So on the Reservation form datacard for RegistrationNumber, set the Items: property of the dropdown/choice control to;

 

Filter(Choices(Reservation.RegistrationNumber), Value in Filter(Vehicules, Status="Available").RegistrationNumber)

This will filter the available options down to those that have an "Available" status in the Vehicules list.  Just be aware that if you have more than 500 reservations you may run into delegation issues.

 

Hope this helps,

 

RT

Highlighted
Frequent Visitor

Re: Filter a lookup field based on another list columns

Thank you for the quick response good sir,

 

i tried your formula, wich is totally correct, but sadly no luck the dropdown shows no results and i don't know why.

Highlighted
Microsoft
Microsoft

Re: Filter a lookup field based on another list columns

Hi medBrami,

 

Can you take some screenshots of the controls and their formulas?

You can also break the formula up to see which parts work and which don't separately, before stringing it all together - so;

 

use this on the Items: property of a dropdown;

Filter(Vehicules, Status="Available").RegistrationNumber

or just 

Filter(Vehicules, Status="Available")

and set the Field: property of the dropdown control to RegistrationNumber

 

If this returns the expected result, then move onto the next piece and so forth.  Test each piece separately and perhaps we can find where it's breaking down.

You can also post some screenshots that show the controls and formula's and perhaps any errors and we can try resolve from there.

 

 

Kind regards,


RT

View solution in original post

Frequent Visitor

Re: Filter a lookup field based on another list columns

UPDATE

the first formula worked like a charm it was just the registration number field type, i forgot and set it to a lign of text

thank you very much you helped me a lot,

Best regards 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,646)