I'm trying to use a Lookup Table Extension with Variable type array. My assumption is if the Data Source Lookup Value In (positions) is an array, the Destination Data Source (pos) will also be an array. I can't get this to work.

Silver Contributor
Silver Contributor
How to use Lookup Table Extension with a Variable type of array
2 REPLIES 2
Highlighted

I'm trying to use a Lookup Table Extension with Variable type array. My assumption is if the Data Source Lookup Value In (positions) is an array, the Destination Data Source (pos) will also be an array. I can't get this to work.

Tealium Employee
Hi Steve, Make sure the destination variable is first declared and second has a variable type of array before you try to output the result. Otherwise the lookup will try to output to an array variable that does not exist, or try to output an array item to a string. Both will throw a type error. You can do this by using a Set Data Values extension before the lookup table. If your output variable is var11, then in the Set Data Values extension set var11 to JS Code with a value of "[]" without the quotes. I'm attaching a screenshot after this comment for you to view. I tested this out and it outputs an array of values.
Highlighted

I'm trying to use a Lookup Table Extension with Variable type array. My assumption is if the Data Source Lookup Value In (positions) is an array, the Destination Data Source (pos) will also be an array. I can't get this to work.

Silver Contributor
Silver Contributor
Thanks that was the missing link.