Use NOT_SET in Script If/else expression

Hi,

I have been looking for a way to check if a script variable is empty in a if/else expression, but haven't found any clear guidance.

Is it possible to check for null values by below structure, and setting the right hand side to Text Expression?

If {{variable}} Does Not Equal (Ignoring Case) NOT_SET

Or should it be done in a different way?

Hi Philip
You should be able to create a dynamic variable with type True/False whose value is the length of your variable. For example, a variable named "variable" could have a corresponding dynamic variable "variableLength" with the value length({{variable}}).
Then your if/else could check that variableLength is greater than 0.

1 Like

Hi @jacobshaw,

That's a good work around, and would most definitely work! I actually got it working by using my proposed solution, or so it seems at least.

So I guess an if/else statement within the actual dynamic variable to set true if > 0 else false? Would be useful when I don't want to build an action in Scripts, and I can actually come up with a few use cases already. Thanks!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.