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

198
Views
Filter Table Data Based on Multiple Comma Separated values

Currently, I am having a regex js function that filters the data based on the text entered in the input text, but I want to filter data based on values present in an array. Let say if the array contains 2 values, then it should filter the table for a particular column having either of those values.

function filter_data(Array, column_name, filter_text) {

      let data_provider = () => {

        const filterRegEx = new RegExp(filter_text, "i");

        let filter_value = {};

        filter_value[column_name] = filterRegEx;

        const filterCriterions = {
          op: "$or",

          criteria: [
            { op: "$regex", value: filter_value },
          ],
        };

        Array = new ArrayDataProvider(Array)

        return new ListDataProviderView(Array, { filterCriterion: filterCriterions });
      };

      return data_provider();
    }

The above function, I provide Array Data Provider, column name and filter text as a parameter. Now instead of filter text I want to provide array containing multiple values and filter the table based on those values. Please help me in this approach or specify any other approach that will work in this case.

about 4 years ago · Juan Pablo Isaza
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!