Mapping values from one JSON to another array of JSON objects

Answered

Hey guys, any help is appreciated. Really stuck here and it is holding my project back.

I have an array of JSON objects that I have stored in var_1

I call some Cloud functions, that processes some data and returns me another JSON object that looks like this,

How can I map these scores, back to the var_1 where the var_1.name == the key of the api_1's result? I want to return this back with the scores preferably looking like this,

[{"name":"Bhavika","meaning":"Well-meaning, righteous, demure girl","origin":"Sanskrit", "score": 9},{"name":"Umika","meaning":"Daughter of the ocean, symbolizing grace and beauty","origin":"Japanese", "score": 5},{"name":"Vasanti","meaning":"Goddess of spring, symbolizing delicate beauty and purity","origin":"Sanskrit", "score": 3},{"name":"Wakana","meaning":"Harmonic beauty, demure and gentle","origin":"Japanese", "score": 7},{"name":"Vaishnavi","meaning":"Signifying adherence to righteousness, demure yet divine","origin":"Sanskrit", "score": 2}]

Every solution I have in mind, seems like an overkill for something as simple as this. Deeply appreciate any help that comes along!

2 replies