Content Expression Language

Are you confused about all the different types of expressions from coding that are used in the software? Get to know them and learn how to use them here.

Content:

The different data output of a variable

When you turn on the HTML view in the template the variables will appear with {the name of the data variable}. In the following examples, we will use {x, y, z} to represent data variables. 

If you want to work with your data variables it is important that you know which type of output it is. In the table below you see the different data outputs in the software and what they mean. 

Output Example Explanation
Text This is free text It is a regular text that can be used directly in the text
Number 150 Can be used directly in the text or to make calculations
Date 29-06-2022 Can be used directly in the text or calculate the time difference
List Item 1, item 2, item 3 Can be used directly in the text as an enumeration or bullet points 
Boolean True/false Tells whether an expression is true or false

You can spot the output type on the right side of the data variable.

Now that you know the different kinds of data outputs and how to spot them, let us take a look at how you can work with them in the template. 

The following operators can be used in conditions and in extra variables.

Text operators

Text operators can be used to work with data variables with text as the output.

Operator Expression Explanation Output type
Contains {x} contains 'a' Whether {x} contains the text 'a' Boolean
Not contains {x} notcontains 'a' Whether {x} not contains the text 'a' Boolean
Equal to {x} = 'a' Whether {x} is equal to the text 'a' Boolean
Not equal to {x} != 'a' Whether {x} not equal to the text 'a' Boolean
Starts with {x} startswith 'a' Whether {x} starts with the text 'a' Boolean
Ends with {x} endswith 'a' Whether {x} ends with the text 'a' Boolean

You can also use another text variable instead of 'a' e.g. {x} contains {y}

Number operators

Number operators can be used to work with data variables with a number as the output.

Operator Expression Explanation Output
Less than {x} < {y} Whether {x} is less than {y} Boolean
Less or equal to {x} <= {y} Whether {x} is less than or equal to {y} Boolean
Greater than {x} > {y} Whether {x} is greater than {y}  Boolean
Greater or equal to {x} >= {y} Whether {x} is greater than or equal to {y} Boolean
Equal to {x} = {y} Whether {x} is equal to {y}  Boolean
Not equal to {x} != {y} Whether {x} is not equal to {y} Boolean
Add {x}+{y} Adding {y} to {x} Number
Substract {x}-{y} Substracting {y} from {x} Number

{y} can also be a number you write yourself e.g. {x} - 150

You can basically use all types of math operators when the data output is a number, so knock yourself out.

Date operators

Date operators can be used to work with data variables with date or time as the output.

Operator Expression Explanation Output
Less than {x} < {y} Whether {x} is less than {y} Boolean
Less or equal to {x} <= {y} Whether {x} is less than or equal to {y} Boolean
Greater than {x} > {y} Whether {x} is greater than {y}  Boolean
Greater or equal to {x} >= {y} Whether {x} is greater than or equal to {y} Boolean
Equal to {x} = {y} Whether {x} is equal to {y}  Boolean
Not equal to {x} != {y} Whether {x} is not equal to {y} Boolean
Timespan {x}-{y} Timespan between {x} and {y} Number
DaysDiff {x} daysdiff {y} Days difference between {x} and {y}  Number
MonthsDiff {x} monthsdiff {y} Months difference between {x} and {y}  Number
YearDiff {x} yeardiff {y} Year difference between {x} and {y}  Number
AddDays {x} adddays {z} Adds {z} days to {x} Date
AddMonths {x} addmonths {z} Adds {z} months to {x} Date
AddYears {x} addyears {z} Adds {z} years to {x} Date
SubDays {x} subdays {z} Subtracts {z} days from {x} Date
SubMonths {x} submonths {z} Subtracts {z} months from {x} Date
SubYears {x} subyears {z} Subtracts {z} years from {x} Date

{y} can also be a date or time you write yourself e.g. {x} < 30-06-2022

List operators

List operators can be used to work with data variables whit a list as the data output.

Operator Expression Explanation Output
Contains (list) {x} contains {y} Whether all elements in {y} are in the list {x} Boolean
Contains (element) {x} contains {z} Whether the element {z} is in the list {x} Boolean
Not contains (list) {x} notcontains {y} Whether all elements in {y} are not in the list {x} Boolean
Not contains (element) {x} notcontains {z} Whether the element {z} are not in the list {x} Boolean
ContainsAny {x} containsany {y} Whether any of the elements in {x} are in {y} Boolean
Equal to {x}={y} Whether {x} and {y} contain the same elements (in any order) Boolean
Not equal to {x}!={y} Whether {x} and {y} do not contain the exact same elements (in any order) Boolean
Remove (list) {x}-{y} Remove all elements in {y} from {x} List
Remove (element) {x}-{z} Remove the element {z} from {x} List
Add (list) {x}+{y} Add all elements of {y} to {x} List
Add (element) {x}+{z} Add the element {z} to {x} List
Intersect {x} intersect {y} Intersects if all elements in {x} also is in {y} List
Filter
{x} filter {{v}} contains 'a'
Filters the list to elements that contains 'a'  List

The element {z} can also be a text you write yourself e.g. {x} contains 'free text'

Other operators

Here you have a list of operators that can be used across data outputs.

Operator Expression Explanation Output
And {x} = 'a' && {x} != 'b' Whether {x} is equal to 'a' and not equal to 'b' Boolean
Or {x} = 'a' || {x} != 'b' Whether {x} is equal to 'a' or not equal to 'b' Boolean
Length {x:length} The length of {x} Number
Substring (skip) {x:substring;c;} Skip c amount of characters in {x} Text
Substring (take) {x:substring;;c} Take c amount of characters in {x} Text
Substring until {x:substring_until;c;a} Take until a and skip c amount of characters in {x} Text
Substring from {x:substring_from;c;a} Take from a and skip c amount of characters in {x} Text
Count (list) {x:count} The number of elements in a list Number

Create a list with bullet points

If you want to highlight some of your data you can make a list with bullet points. 

Operator Expression Example
Start list <ul>  
Bullet point <li>{x}</li>  
End list </ul> <li>Materials: {materials}</li>
  1. Add a sentence
  2. Convert the scenario within the sentence
  3. Name the first sentence within the converted scenario e.g. "Start list"
  4. In the variant write: <ul>
  5. Add a sentence for every bullet point and write in the variant: <li>{x}</li>
    An example could be: <li>Materials: {materials}</li>
  6. Add the last sentence and name it e.g. "End list"
  7. In the variant write: </ul>