(solved) Trying to check if variable has no text

image

this event is not working any idea why is it not correct syntax?

edit : it was a bug in my code

Hi try something like this with the OTHER ACTIONS → Compare two strings

does not work either

You can also use “Compare two numbers StrLength(YOUR_STRING) = 0” but unfortunately many times you will get back a literal string “0” for a variable used with mixed types.

I ended up writing my own custom condition using javascript to determine if a string is empty:

const input = String(eventsFunctionContext.getArgument("string"));
if (input === null || input === "null" || input === "" || input === "0" || input.length === 0)
{
   //console.log("String " + input + " is empty");
   eventsFunctionContext.returnValue = true;
   return;
}
//console.log("String " + input + " is NOT empty");
eventsFunctionContext.returnValue = false;
2 Likes

Consider submitting that extension :eyes: