Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

124
Vistas
Not able to filter data as expected
this.prepData.filter(e=>e.workflowRoleDesc!=s)[1].userList.filter(e=>e.value != filteredData.map(e=>e.userId))

this.prepData basically looks like this, inside userList we have another array which has a field called value.

0: {workflowRoleDesc: 'Preparer', userList: Array(61), isRoleEnable: true}
1: {workflowRoleDesc: 'Reviewer', userList: Array(44), isRoleEnable: true}
2: {workflowRoleDesc: 'Approver', userList: Array(49), isRoleEnable: true}

length: 3
[[Prototype]]: Array(0)

s is string variable which can have one of the following value at a time Preparer, Reviewer or Approver.

and

filteredData.map(e=>e.userId)
(2) ['86cb7ae5-2b56-4437-af5a-115018d69403', '188e20db-db56-41c9-9bfa-20c7d02b4da0']

In the second filter when I am using filteredData.map(e=>e.userId), it does not filter anything but if I give the value '86cb7ae5-2b56-4437-af5a-115018d69403' directly it is working as expected.

What can I do to make it work?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Well, you are comparing a value (which seems to be a string) with an array of strings filteredData.map(e=>e.userId). Maybe you should use:

this.prepData
  .filter(e=>e.workflowRoleDesc!=s)[1]
    .userList.filter(e=>filteredData.map(e=>e.userId).indexOf(e.value) < 0)

Meaning that you want to use the users that are NOT among the filteredData ones.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda