Hi Everyone i wanted to filter an array based on the array that I receive which contains column name condition and the value so let me just how the two array looks.
So this is what the array looks like from which I want to filter
[
{
"unique_id": 35264,
"flash_candidate_id": 0,
"first_name": "YAP CHIN SIEN",
"last_name": "",
"email_id": "[email protected]",
"tag_name": "Career Page ( sign up )",
"position_name": "Fraud & Risk Specialist ",
"campaign": "Airbnb Ireland (ABNB-MYS)",
"location": "Malaysia",
"job_req_id": 22017,
"test_name": "Personality Test",
"test_question": "AirBnB - Chinese Email Exam",
"overall_score_average": null,
"overall_score_percentage": "0%",
"question": "",
"answer": "",
"question_score": 0,
"question_score_percentage": "0%",
"score": "",
"grade": "",
"test_comments": "",
"presonality_result": "The Dynamic Thinker - ENTJ",
"status": "Open",
"remarks": "",
"source": "",
"medium": ""
},
]
This is the second filter array which contains the column name, value, and should it contain or not
filterArray: [
{
"columnName": "first_name",
"condition": "equal to",
"value": "Some name"
},
{
"columnName": "last_name",
"condition": "equal to",
"value": "Some last name"
},
]
So I don’t understand how I can filter the original array based on the filter array that I receive
and the thing is the objects props will be dynamic so if one time first_name will be there if they are doing for selected data and the other time the original array will contain totally different values based on the selected data that’s why I am asking dynamically.