Transforming and matching table data to separate query data

Hi. I have a dataset in a table that contains a heading of ObjectID that i get from query1.
in query2 i have another data set that matches objectID to a name. 3412AE29F, "Straw Hat"

I want to create a custom column in the table for query1 that shows the name of that object that matches using query2

let res = [];
{{}}.forEach(id => {

// res.push(what goes in here);
return res;

You can see i am starting to try to grab the entry but not getting far.
i want to push to the res array the for the match between ===

javascript is a bit new to me coming from php side of things so i'd appreciate the help.

I got this to work, but i feel like there should be an easier way.
res.push({{}}[{{}}.findIndex(element => element === id)]);

Hey @dlbhilbig!

I think there are a bunch of ways you can do this, good to hear you already found one :slightly_smiling_face:

Here's one I like but it's totally up to preference!

const objectIDs = {{ }};
const {string, blankUIC} = {{ }};
const findName = (id) => string[blankUIC.indexOf(id)];

You can also stick JavaScript straight into your custom column, so you could do something like the following directly in the "Value" field of your custom column:

{{[] }}
1 Like

Thanks so much, i love the inline method, and implemented that. Coming from a php background, there is a lot of learning happening on the fly. I appreciate you!