Microflow Expressions

4 minutes to read Download PDF Edit

Expressions can for example be used to change a member of an object based on logic. Variables in the microflow can be called in an expression by inserting the name of the variable and adding a dollar sign. E.g. $customer refers to the variable customer. Expressions can be used recursively, e.g., 1 + 2 + 3. Attributes and associations of object variables are accessed using a slash, e.g., $customer/Name, _$customer/CRM.CustomerOrder.

To illustrate this imagine an object with variable name package with two attributes: weight (Float) and _shippingCosts _(Decimal). Rule: if the weight of a package is less than one kilogram there are no shipping costs. Otherwise the shipping costs are €5.00. The expression for changing attribute shippingCosts is: if $package/weight < 1.00 then 0.00 else 5.00.

An overview of the possibilities with expressions can be found below.

Unary Expressions:

Arithmetic Expressions:

Relational Expressions:

Special checks

Boolean expressions

If expressions

Mathematical function calls

  • max - Maximum of a list of numbers
  • min - Minimum of a list of numbers
  • round - Rounding a floating-point number, optionally to a specified precision
  • random - Random number generation
  • floor - Rounding a floating-point number down
  • ceil - Rounding a floating-point number up
  • pow - Exponentiation
  • abs - Absolute value
  • floatsEqual / currenciesEqual - Equality of floats/currencies for a certain precision (deprecated)

String function calls

Date creation

  • dateTime - Creating a date value using the server’s calendar
  • dateTimeUTC - Creating a date value using the UTC calendar

Between date function calls

Add date function calls

Trim to date

To string

To float (deprecated)

Parse integer

Parse/format float function calls (deprecated)

Parse/format decimal function calls

Parse/format date function calls

Enumerations in microflow expressions

  • getCaption - Get caption of enumeration value in current language
  • getKey - Get technical name of enumeration value

Copyright © Mendix. All rights reserved. | Mendix.com | Terms of Use | Privacy Policy