# Using two arrays as lookup tables

**URL:** https://discourse.nodered.org/t/using-two-arrays-as-lookup-tables/13408
**Category:** General
**Created:** [17 July 2019 15:12 UTC](https://discourse.nodered.org/t/using-two-arrays-as-lookup-tables/13408 "2019-07-17T15:12:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![martino\_eb](https://avatars.discourse-cdn.com/v4/letter/m/8dc957/32.png) [@martino\_eb](https://discourse.nodered.org/u/martino_eb)
#### Post date: [17 July 2019 15:12 UTC](https://discourse.nodered.org/t/using-two-arrays-as-lookup-tables/13408/1 "2019-07-17T15:12:11Z")

</div>

Hi everyone,

I am trying to build a flow that allows me to combine data from two different arrays A and B to lookup data in array B and substitute it in A in the right spot: for instance, let's say array A lists people with properties like "favourite\_food", but the value for this property is in the form of a code (let's say, favourite\_food: "3"), and what each code refers to is defined in array B (which will therefore have an object with property code: "3" and value: "pizza").

Is there a node/function in Node-RED to combine A and B so that all objects in A with favourite\_food: "3" are changed to say favourite\_food: "pizza"?

In my example both of these arrays come from an API, but at least one of them could be saved and imported with a CSV, if that helps. Also, if it sounds like I don't know what I'm talking about, it's because I really don't: my coding knowledge is extremely limited, but I am trying to find out if Node-RED could still be intuitive enough for me to use. So bonus points if the solution involves as little code as possible 🙂

Sorry if the request is confusing/weird! I am more than happy to provide some clarification, of course.  
Thanks!

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [17 July 2019 15:13 UTC](https://discourse.nodered.org/t/using-two-arrays-as-lookup-tables/13408/2 "2019-07-17T15:13:30Z")

</div>

Please provide some example data/input.
