Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

129
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda