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!
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:
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 (Colaboradores) reference 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 (Colaboradores) reference values from. The ReferencedColumn represents the column in your LookUp List, which your LookUp column (Colaboradores) reference values from.
Best regards,
Kris
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
The Colaborador field
The Colaborador:amdsts_codigo 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
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:
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?
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
Hi Kris!
These are the types o Nombre_Apellido and admsts_codigo of BDEmpleados List
This is the data of the BDEmpleados list
The formula has no errors but still the results are nothing..
don´t know what else to try
Did you ever solve this?
Filter(
Choices('20181121_LookUpList'.Colaboradores),
Value in Filter('20181121_case8','Colaborador status'.Value="A").EmpName
)
so if you noticed i added .Value that is how it should be and it worked for me
Filter(
Choices('20181121_LookUpList'.Colaboradores),
Value in Filter('20181121_case8','Colaborador status'.Value="A").EmpName
)
so if you noticed i added .Value that is how it should be and it worked for me
User | Count |
---|---|
260 | |
110 | |
97 | |
53 | |
39 |