New Expression Features
4 min
the following are the new features and changes to activate expressions in v8 expression escaping v7 and older allowed expressions to be written in double quotes (") in expressions for example, \=isnull(=/task/parametername) this expression is ok because the expression in the function does not contain any special characters \=isnull("=/task/web parameter") this expression requires quotes because the expression contains special characters like a dot ( ) character v8 also allows you to quote expressions with a single quote (') character visible="=isnull('=/task/web parameter')" this expression is also valid this is useful if the surrounding value is double quoted " v8 also allows you to surround expressions with curly brackets {} visible="=isnull({=/task/web parameter})" this expression is also valid this is useful if the surrounding value is double quoted " \=> evaluator a new shorthand expression for eval \=eval(1 7) is valid in v7 \=>1 7 is now valid in v8 $= expressions there are times where you want to have an expression that contains string expansion but you don't want to execute the main expression and return the resulting expression for example $=isnull('=//drafts/6351/relatedusers') would return $=isnull('=//job/123456/relatedusers') $=eval(%=//parent/customtypes/path%) would return $=eval(=//roles/custom user types/employee) if the customtypes parameter of the current parent pointed at //roles/custom user types use \ to escape = for expressions that should not be expanded for example "$=filter('=//jobs/a8e02bd3 ee19 4809 9b40 9201fbccbf1f/relatedusers', '@=>{%\\=/guid%} != \\'%\\=//currentuser/guid%\\'')" changed or updated functions function description isdefined added overload to check if value is isdefined it is the opposite of isnull \=isdefined('=/myparameter") == =not(=isnull('=/myparameter)) isnumber(s) new function to check if the argument is a number \=isnumber("1") == true \=isnumber("s") == false toint(v, defaultvalue) added ability to have a defaultvalue if v cannot be converted to a number, previously returned null checkaccess added new options checkaccess(object, rights) | checkaccess(rights) call added call(obj, "method", args) this can be used to call a function on a builtin object or can have any number of arguments and returns true if one is true for example or(=/arg1, =/arg2, =/arg3) trim(s, \[trim,\[trim]]) trim the start and end of the string with any arguments trim(s) trim all white space trim(s, ' ') trim any ' ' from the start or the end trim(s, 'dl') trim 'dl' from the start or the end note this trim is case sensitive trimstart(s, \[trim, \[trim]]) trim the start of the string with any arguments trimstart(s) trim all white space from the start trimstart(s, ' ') trim any ' ' from the start trimstart(s, 'dl') trim 'dl' from the start note this trim is case sensitive trimend(s, \[trim, \[trim]]) trim the end of the string with any arguments trimstart(s) trim all white space from the end trimstart(s, ' ') trim any ' ' from the end trimstart(s, 'dl') trim 'dl' from the end note this trim is case sensitive