Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

123
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!