SCENARIO:
I currently have two JSON files named contacts and workers:
contacts
[
{
"name": "Jhon Doe",
"gender": "Male",
"workers": [
"e39f9302-77b3-4c52-a858-adb67651ce86",
"38688c41-8fda-41d7-b0f5-c37dce3f5374"
]
},
{
"name": "Peter Parker",
"gender": "Male",
"workers": [
"e39f9302-77b3-4c52-a858-adb67651ce86",
"40665c50-ff74-4e81-b968-e127bdf1fe28"
]
},
{
"name": "Mark Wood",
"gender": "Male",
"workers": ["ed780d15-428b-4bcd-8a91-bacae8b0b72e"]
},
{
"name": "Mary Jane",
"gender": "Female",
"workers": [
"40665c50-ff74-4e81-b968-e127bdf1fe28",
"ed780d15-428b-4bcd-8a91-bacae8b0b72e"
]
}
]
workers
[
{
"id": "e39f9302-77b3-4c52-a858-adb67651ce86",
"name": "Alfy Odhams"
},
{
"id": "38688c41-8fda-41d7-b0f5-c37dce3f5374",
"name": "Allsun Suttle"
},
{
"id": "ed780d15-428b-4bcd-8a91-bacae8b0b72e",
"name": "Alvinia Ettritch"
},
{
"id": "40665c50-ff74-4e81-b968-e127bdf1fe28",
"name": "Ambrosi Lindenstrauss"
}
]
I am presenting the contacts like this:
https://i.stack.imgur.com/VVoCe.png
EXPECTED RESULT :
I aim to exhibit the assigned worker's name for each contact based on their ID as shown here:
https://i.stack.imgur.com/JQIX9.jpg
Check out the DEMO on StackBlitz.