Designers > K2 Designer for Visual Studio > Design Tools > Inline Functions > Function Browser > Expression > Build Expression > Special Operators | Send feedback |
Operator | Description | Example |
---|---|---|
when | Used to execute one of two sub-expressions based on a condition. |
Input Value: when 1=1 then "yes" otherwise "no" |
format | Used to format a non-textual value into a textual value. | Input Value: 1 format "0.0" Result: 1.0 |
This operation allows you to select which piece of the expression you would like to execute based on a Boolean (true/false) value. For instance:
Copy |
---|
when 5 > 10 then "Yes" otherwise "No" = when false then "Yes" otherwise "No" = "No" |
More generally, when condition then true part otherwise false part
There are two restrictions:
The expression engine will not evaluate the true part or false part if it does not need to. This means if you have a SmartObject Create in the true part and the condition is false then the SmartObject Create will not be called.
The format operator allows you to format a number, date, etc. according to a certain format string. For instance: [DateField] format "yyyy mm dd". It The standard .Net formatting format is used.
The following online references can be found: Dates:
|