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

Data Element - Empty String Default Value Bug?

Avatar

Avatar
Boost 1
Level 1
mikeb55262024
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
Applaud 5
View profile

Avatar
Boost 1
Level 1
mikeb55262024
Level 1

Like

1 like

Total Posts

5 posts

Correct Reply

0 solutions
Top badges earned
Boost 1
Applaud 5
View profile
mikeb55262024
Level 1

15-01-2020

Setting default value for data element 'JavaScript Variable' when the actually JS value is an empty string doesn't return the 'Default Value' is set within the data element. An empty string is returned instead. Since an empty string is considered to be a false type in JS, developers might expect then to rely on the 'Default Value' to be populated instead. 

 

Is anyone else experiencing this? If so, this should be updated if the JS path resolves but return an empty string vs a ref error, then the data element should fallback on the default value. 

 

mikeb55262024_0-1579112138976.png

Data Elements default value javascript launch

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Shape 1
Level 3
franzli
Level 3

Likes

28 likes

Total Posts

26 posts

Correct Reply

13 solutions
Top badges earned
Shape 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Shape 1
Level 3
franzli
Level 3

Likes

28 likes

Total Posts

26 posts

Correct Reply

13 solutions
Top badges earned
Shape 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
franzli
Level 3

17-01-2020

Default Values get populated on Launch based off:

 

  • typeof VARIABLE returns "undefined"
  • VARIABLE returns "null"

A blank string is technically a blank string and that would just return naturally.

 

So the best way is to run a Custom Code and return null when it comes to a blank string.

Answers (0)