Is there a simple way to do if-elif-elif in an eval statement? Support 3 or 4 tests
Support 3 or 4 tests
Best Answers
-
There are a couple simple approaches using the Lookup Function or the Eval Function that should be easy to understand and maintain.
IN:
Example 1: The Lookup Function
Under Knowledge Lookups, create a Lookup TableAdd a Lookup Function (Advanced Settings Ignore Case)
Example 2: The Eval FunctionThe syntax of
/^IN$/i.test(direction)
is a case insensitive(i)
regular expression that tests for a match in the fielddirection
. The^
and$
represent the beginning and end of the value. The first line of the evan ensures that a direction field is not created if direction is not defined.1 -
0
Answers
-
There are a couple simple approaches using the Lookup Function or the Eval Function that should be easy to understand and maintain.
IN:
Example 1: The Lookup Function
Under Knowledge Lookups, create a Lookup TableAdd a Lookup Function (Advanced Settings Ignore Case)
Example 2: The Eval FunctionThe syntax of
/^IN$/i.test(direction)
is a case insensitive(i)
regular expression that tests for a match in the fielddirection
. The^
and$
represent the beginning and end of the value. The first line of the evan ensures that a direction field is not created if direction is not defined.1 -
0