How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Gold Contributor
Gold Contributor
 
9 REPLIES 9

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Employee Emeritus
Hi Rohan! The lookup table extension does not support load rules. Can you be more specific on what you are trying to achieve? It sounds like you are trying to set a data source variable. In that case you can achieve that by using the Set Data Values extension with a condition.

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Gold Contributor
Gold Contributor
Hello Jasmine. I'm trying to capture a float value (article rating) from an article page using the lookup table which rolls up incoming values to it's closest match. E.g. Star Rating 3.6 will be mapped to 3.5 and this is working on the article page. Also, Star Rating 0 gets mapped to 'N/A' and I've not specified any default value. The problem I'm having is that this data object variable is getting set to 'N/A' on all pages of the website other than the article page. I'm trying to figure out the best way to only capture it just on the article page using the lookup table.

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Gold Contributor
Gold Contributor
By the way, I've already tried the Set extension and a separate JavaScript snippet to limit the data object to only fire on the article page without any luck. The lookup table doesn't allow me to scope that data object to a condition and acts globally.

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Employee Emeritus
Hey Rohan, I'm about to riff here so beware. If you are passing the rating to a single tag then you could either 1) set the load rule for the tag and scope the extension to the tag 2) if the tag(s) are running more broadly (say all pages) you could set up a second instance of the tag with a load rule for those specific pages, follow the previous option and assign a load rule to the primary tag that excludes those pages to avoid double-firing 3) (way out on a limb here) set up a custom container tag with null or nothing in it that has the load rule you want and then scope the extension to that (tag order would be critical at that point) 4) something I haven't thought of that is way better than any of the above

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Employee Emeritus
Hi Rohan. "Rating 0 gets mapped to 'N/A' and I've not specified any default value. The problem I'm having is that this data object variable is getting set to 'N/A' on all pages of the website other than the article page." Apologies in advance if you already know what I'm about to write. I'm detailing the cause in case others reading this are wondering why this is happening. Let's just call this variable 'myVar'. You're seeing this probably due to the fact that in JavaScript, the value of 'zero' is equal to an empty string: 0 == "" If you evaluate it, it will return true. So probably on your site on the non-article pages, this variable is being defined, but is empty. Since empty is equal to zero, you're getting N/A on all these pages. As for a solution, if you just want to empty out this variable, the easiest way to do it is to: 1) Have a Set Value extension run right after it and scope it to the same tags. It's important they match in scoping and that this extension runs after the lookup table, or this won't work. 2) Then set a condition for running only on non-article pages like: URL -- DOES NOT CONTAIN -- ARTICLE That way on any page that is not an article, it will run 3) Set 'myVar' to text "" That's just two quotes, or an empty string. This will blank out 'myVar' and send nothing on non-article pages. If you want to outright delete this variable, it will require some custom written JavaScript. If this is what you're looking for, please contact your account manager so we can set that up for you. Hope this helps!

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Employee Emeritus
Hi Rohan, Here is something for you can try out to leverage your Lookup Table as well as the Set Data Value extension. Keep in mind the variables and conditions will vary depending on your implementation. There are probably multiple ways to implement this, but this is a solution I came up with for now. You mentioned that you were trying "to capture a float value (article rating) from an article page using the lookup table which rolls up incoming values to it's closest match." 1. Let say I have a Data Source variable called 'article_rating' set to 3.6set' when querystring contains 'page=article'. So when I have hit the article page (with the querystring 'page=article'), my datasource value will now change to '3.6set'. 2. Right under this extension, add a Lookup Table Extension. Where the Lookup Value In: 'article_ratings' Destination: 'article_ratings' Variable Type: string match type: exact Lookup Match: 3.6set Output: 3.5 In this lookup match '3.6set' is the value set AFTER visiting the page where I wanted. Therefore, I will match this specific value to the output desired. If your value was never set to '3.6set' the lookup table won't match it up. You can use a 'different' mapping to leverage the Lookup Table this way if you want to roll incoming values to the closest match. Or use any string you want. Hopefully this is helpful. Please contact your account manager if there are questions or you need help setting anything up.

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Employee Emeritus
Based in the question asked I would create a second, temporary variable in the data sources and use set the lookup table to that temp variable. I would then use a set data extension to set the destination data object variable to that temp variable with a condition based on URL. Scope both extensions to all tags and make sure the lookup table sits above the set data extension. Does that answer your question?

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Gold Contributor
Gold Contributor
Wow, Thanks so much everyone for jumping on to help me. The issue is now fixed. The fix was to move the 0=='N/A' condition out of the Lookup table into its own Set extension and mapping the output to a temporary variable which was then scoped to the article URL using the Set extension.

How do I scope the lookup table extension to a load rule or a condition? We only want it to set the destination data object variable on a specific URL which is not happening currently.

Employee Emeritus
Glad we were able to help you figure out a solution efficiently. If you have any further questions don't hesitate to ask.
Public