Consider the following scenario with JSON data:
sampledataA = [
{"id": 1,"employee_id": 1},
{"id": 2,"employee_id": 1},
{"id": 3,"employee_id": 1},
{"id": 4,"employee_id": 2},
{"id": 5,"employee_id": 2},
{"id": 6,"employee_id": 2},
{"id": 7,"employee_id": 3},
{"id": 8,"employee_id": 3},
{"id": 9,"employee_id": 3}
]
sampleDataB = [
{"employee_id": 1, "name":"Name1"},
{"employee_id": 2, "name": "Name2"},
{"employee_id": 3, "name": "Name3"}
]
In my controller, I need to extract the employee_ids from sampleDataA and then filter these employee ids against sampleDataB in order to retrieve the corresponding names. Is it feasible to achieve this within the controller?