Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How do I capture boolean values from JS varible

Avatar

Avatar
Validate 1
Level 1
kshafer42
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
kshafer42
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
kshafer42
Level 1

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
Shape 25
MVP
Andrey_Osadchuk
MVP

Likes

524 likes

Total Posts

945 posts

Correct Reply

255 solutions
Top badges earned
Shape 25
Bedrock
Coach
Boost 500
Affirm 250
View profile

Avatar
Shape 25
MVP
Andrey_Osadchuk
MVP

Likes

524 likes

Total Posts

945 posts

Correct Reply

255 solutions
Top badges earned
Shape 25
Bedrock
Coach
Boost 500
Affirm 250
View profile
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
Validate 1
Level 1
kshafer42
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
kshafer42
Level 1

Like

1 like

Total Posts

7 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
kshafer42
Level 1

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?