In load rules, what exactly does "is populated" check for? What does it return if the variable exists in the data layer and - null is assigned to it - it is undefined? How do I check for "variable exists AND is not null AND is not undefined"?

Silver Contributor
Silver Contributor
does "is populated" check for null?
2 REPLIES 2

In load rules, what exactly does "is populated" check for? What does it return if the variable exists in the data layer and - null is assigned to it - it is undefined? How do I check for "variable exists AND is not null AND is not undefined"?

Employee Emeritus
"Is populated" checks whether the variable is equal to an empty string. "Is defined" checks whether the variable is undefined or null. In general, to get the effect you would expect, you have to always combine both conditions with an AND rule, so that your load rule says the variable "is defined" AND "is populated".

In load rules, what exactly does "is populated" check for? What does it return if the variable exists in the data layer and - null is assigned to it - it is undefined? How do I check for "variable exists AND is not null AND is not undefined"?

Tealium Employee
Hi Andreas, The load rule condition "is populated" works by: 1) Checking if the variable inside the utag.data is not undefined 2) AND Checking if the variable is not empty. So for example an "is populated" rule would look like: (typeof utag.data['dom.domain'] != 'undefined' && utag.data['dom.domain'] != '') Unfortunately, to do what you want, to do "variable exists AND is not null AND is not undefined" isn't possible using just load rules. The only real way to test for null would be to use a Pre-Loader extension that checks the variable in the data object, and then converts it to be undefined, which you can then use the "is defined"/"is populated" rules. Adrian
Ask me anything Tealium related or TypeScript/JavaScript, or NodeJS.
Please remember to mark solutions as accepted for future searchers.
Public