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

Dropdown filter from lookup field

Hi!

 

I´m trying to filter a dropdown base on a second field on the same lookup table.

 

These are my cotrols:

Data Source: Solicitudes

Combo Box Name:cboColaboradores

 

Items properties: Choices(Solicitudes.Colaboradores)  --This shows a name list from a Sharepoint Lookup Field.

 

This lookup fied has another field name Colaborador_x003a_status with values like A(Active) and I(Inactive)

 

I tried to filter by these Status.

 

Filter(Choices(Solicitudes.Colaboradores),Colaborador_x003a_Status.Value =  "A")  ---- result=nothing

 

also tried:

Filter(Choices(Solicitudes.Colaboradores),Colaborador_x003a_Status =  "A")  -- but says "Invalid argument type"

 

if i test the Status values using Choices(Colaborador_x003a_Status) it shows theses values, meaning the values are there

 

it is the type?

 

What i´m missing?

 

Thanx in advance!

 

6 REPLIES 6
Community Support Team
Community Support Team

Re: Dropdown filter from lookup field

Hi @joeljohn,

Could you please share a bit more about Colaborador status column in your SP list? Is it a Choice type column or a Single line of text type column?

Do you add another field for the LookUp column (Colaboradores) within your SP list?

I have made a test on my side, I think there is something wrong with the formula that you provided. The result the Choices(Solicitudes.Colaboradores) formula returned only contains Id property and Value property, it does not contain Colaborador_x003a_status property.

Actually, if you add another field for the LookUp field (Colaboradores) within your SP list, it would add another field within your SP list. The new added column is based on the LookUp column.

If you want to filter your LookUp column values based on the Colaborador_x003a_status property through the formula that you provided, I afraid that there is no way to achieve your needs.

As an alternative solution, please take a try with the following workarond:3.JPG

Set the Items property of the Combo Box control to following:

Filter(
Choices('20181121_LookUpList'.Colaboradores),
Value in Filter('20181121_case8','Colaborador status'="A").EmpName
)

Note: The '20181121_LookUpList' represents the SP list contains the LookUp column (Colaboradores). The '20181121_case8' represents the SP list your LookUp column (Colaboradoresreference values from. The EmpName represents the column in '20181121_case8' which your LookUp column (Colaboradores) reference values from.

On your side, you should type the following formula within the Items property of the Combo Box control:

Filter(
Choices(Solicitudes.Colaboradores),
Value in Filter('LookUpList', Colaborador_x003a_status ="A").ReferencedColumn /* <-- I assume that the Colaborador_x003a_Status column is a Single line of text column in your LookUp list */
)

Note: The 'LookUpList' represents the SP list which LookUp column (Colaboradoresreference values from. The ReferencedColumn represents the column in your LookUp List, which your LookUp column (Colaboradores) reference values from.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
joeljohn
Level: Powered On

Re: Dropdown filter from lookup field

 

Hi Kris, 

 

Thanx for your detailed solution...

 

First:

1. This is the Solicitudes SP list

2. The Colaborador field is a lookup from the SP List BDEmpleados(Name field)

3. The Colaborador:admsts_codigo field (Status field) is a second field from the SP List List BDEmpleados(Status Field)

 

Solicitudes fields

Captura.PNG

 

The Colaborador field

Captura.PNG

 

The Colaborador:amdsts_codigo field            

Captura.PNG

 

 

Community Support Team
Community Support Team

Re: Dropdown filter from lookup field

Hi @joeljohn,

Just as I mentioned above, if you want to filter your LookUp column values based on the Colaborador:admsts_codigo field through the formula that you provided, I afraid that there is no way to achieve your needs within PowerApps.

The result the Choices(Solicitudes.Colaborador) formula returned only contains Id property and Value property, it does not contain Colaborador:admsts_codigo property.

As an alternative solution, please type the following formula within the Items property of the Combo Box control:

Filter(
Choices(Solicitudes.Colaborador),
Value in Filter(BDEmpleados, Colaborador:admsts_codigo ="A").NOMBRE_x0020_Y_x0020_APELLIDO

 

Best regards,

Kris 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
joeljohn
Level: Powered On

Re: Dropdown filter from lookup field

HI kRIS ,

 

Thanx for your dedication.

 

Note: It uses plurals : 

Solicitudes.Colaboradores insted of Solicitudes.Colaborador

I tried the formula below,  but  keep getting errors

Filter(
     Choices(Solicitudes.Colaboradores), 
     Value in Filter(BDEmpleados,Colaborador_x003a_admsts_codigo = "A").Colaborador_x003a_Nombre_Apellido
)

Errrors:

Captura.PNG

The allow argments ar exactin and in.

 

I also tried Text() and Value() Funtions.

 

When using Colaborador_x003a_admsts_codigo.Value the error goes away, but the result is empty.

 

I also created a UpdateContext variable to filter.

UpdateContext(StatusList, "A") for using it as:

Filter(
     Choices(Solicitudes.Colaboradores), 
     Value in Filter(BDEmpleados,Colaborador_x003a_admsts_codigo in StatusList).Colaborador_x003a_Nombre_Apellido
)

Any clue?

 

 

Community Support Team
Community Support Team

Re: Dropdown filter from lookup field

Hi @joeljohn,

Which type is the Colaborador_x003a_admsts_codigo column in your BDEmpleados list? Is it a Choice type column?

If the Colaborador_x003a_admsts_codigo column is a Choice type column in your BDEmpleados list, please take a try with the following workaround:

Set the OnVisible property of the first screen of your app to following:

ClearCollect(BDEmpleadosCollection, BDEmpleados)

Set the Items property of the Combo Box control to following:

Filter(
     Choices(Solicitudes.Colaboradores), 
     Value in Filter(BDEmpleadosCollection, Colaborador_x003a_admsts_codigo.Value = "A").Colaborador_x003a_Nombre_Apellido
)

check if the issue is solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
joeljohn
Level: Powered On

Re: Dropdown filter from lookup field

Hi Kris!

 

These are the types o Nombre_Apellido and admsts_codigo of BDEmpleados List

Captura.PNG

This is the data of the BDEmpleados list

Captura2.PNG

 

The formula has no errors but still the results are nothing..

don´t know what else to try

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,310)