fix and optimise Variable Set to Value causing Nan / Null if no value
If value greater than 1 use value, if 1 cmd set true, if 0 or no value, cmd set false.
would be nan if no value (now that data is checked).
@@ -16,6 +16,14 @@ export const fields = [
];
export const compile = (input, helpers) => {
+ if (input.value > 1) {
const { variableSetToValue } = helpers;
variableSetToValue(input.variable, input.value);
+ }else if (input.value == 1) {
+ const { variableSetToTrue } = helpers;
+ variableSetToTrue(input.variable);
+ }else {
+ const { variableSetToFalse } = helpers;
+ variableSetToFalse(input.variable);
+ }
};
