How do I capture boolean values from JS varible

Avatar

Avatar

kshafer42

Avatar

kshafer42

kshafer42

19-08-2019

I have a data element that is using JavaScript variable name to get a value. The values are boolean.

Is it the case that this field can only return string values? It seems that anytime i try to capture a boolean, the data doesn't appear in the analyics debugger.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Andrey_Osadchuk

MVP

Avatar

Andrey_Osadchuk

MVP

Andrey_Osadchuk
MVP

20-08-2019

Hi kshafer42,

Yes, your observation is 100% accurate. The false value will not get populated if set as a reference to a Data Element.

As you already may guess, you can make a transition from boolean to string to make it working. For example, you can create another Data Element that will be mapped to the primary "boolean" Data Element with some JS code that will make the trick.

Answers (1)

Answers (1)

Avatar

Avatar

kshafer42

Avatar

kshafer42

kshafer42

19-08-2019

FUN FACT: if the variable returns "false" it doesn't return any value. Boolean only seems to work if the result it true. Thoughts?