Can a Lookup table retain the destination value if no lookup match is found?

Gold Contributor
Gold Contributor
I have a utag_data variable which could have +1000 unique values. For about 100-200 cases I need to replace the value with another value. I have a sql table which can be used to generate a csv of all the replacement cases for upload into the Lookup Table extension. My question is when there is no match, can the destination value be retained? If my destination variable is called 'name (js)' would I need to put something like b['name'] into the default output? I am using a string variable type and Match type exact.
4 REPLIES 4

Can a Lookup table retain the destination value if no lookup match is found?

Moderator
Moderator
Hi Brian, Currently, the lookup table will always overwrite the destination value with whatever is in the "default output" box, even if the default output is blank. The default output can only accept strings, not javascript variables or arrays. Hope this helps. Thanks, Craig.
Check out our new Swift integration library for iOS, macOS, tvOS and watchOS: https://github.com/Tealium/tealium-swift with updated
documentation https://community.tealiumiq.com/t5/Swift/tkb-p/swift.

Can a Lookup table retain the destination value if no lookup match is found?

Gold Contributor
Gold Contributor
Is there an extension for my use case? The Set Data Values extension is not feasible because the 100-200 uses cases change frequently so a csv upload capability is critical.

Can a Lookup table retain the destination value if no lookup match is found?

Employee Emeritus

Hi Brian,

 

What you can do is use a couple of extensions as a workaround to this.

 

  1. Add a set data value extension to run before the lookup table. This extension will always run and store the original value in a new var. So, if the var you're trying to preserve is named 'lookup_var', you'd have another var, titled something like 'original_var', equal to 'lookup_var'
  2. Your default table runs next in sequence, and the default value (if there is no match) can be something like 'default'
  3. Create another set data value extension to run after the lookup table that only runs if 'lookup_var' is equal to 'default'. If this condition is satisfied, set 'lookup_var' to 'original_var'.

 

Short version:

 

  1. Set data value extension, setting 'original_var' to 'lookup_var'
  2. Lookup table extension setting 'lookup_var', with a default value of 'default' if no match is found.
  3. Set data value extension runs if 'lookup_var' equals 'default. If so, sets 'lookup_var' to 'original_var'

Can a Lookup table retain the destination value if no lookup match is found?

Gold Contributor
Gold Contributor
Thanks Son, that worked. Could a check box be added to the Lookup Table extension UI to retain the original value if no match is found? Which could then skip the final line of code in the Lookup Table extension. if (!m) b['_myVal'] = 'Default Output';
Public