Unexpected token in JSON for Booleans

Trying to add 5 Boolean values into my script using JSON, but for some reason the result isn’t true or false, but x or a checkmark. Is there a way to fix this. And is the syntax ok of line 2?

Have been trying to figure this our for a few hours yesterday, but no luck yet.

For some inexplicable reason, the Athom developers thought it would make sense for boolean tags in flows to render to “⨯” and “✓”, instead of something logical like “false/true” or even “0/1” :man_shrugging:t3:

Which means you need to put quotes around them in the JSON argument, and explicitly check for those two characters in your code.

Thanks Robert that helps a lot! The only thing now is to get my value ‘Waarde’ to increase, but that doesn’t seem to happen. Any clues?

Tried also only the Checkmark and Case 1, Waarde.tostring and Case “1” etc.

The equality operator in JS is ==, not =:

if (slp == "common.✓") { Waarde += 1; }

Although from what I saw, the value is , not common.✓

Thanks! It’s finally working.

let {slp, bed, bad, kst, gas} = JSON.parse(args[0]);
let Waarde = 0;
if (slp == "✓") {Waarde += 1};
if (bed == "✓") {Waarde += 2};
if (bad == "✓") {Waarde += 4;}
if (kst == "✓") {Waarde += 8;}
if (gas == "✓") {Waarde += 16;}

switch (Waarde) {
 case 1: