Transformers

Sometimes the data coming from the universal data model source is not in a format you'd like to be. For example, you want uppercased title of the screen, but the data model only provides a normal case. For this situation, it is also possible to change the values of properties using transformers. Transformers take input value, run it through transformation, and retrieve the result. You use them through dot notation:

{{ name.uppercased() }} // Name = "Welcome"

Producing expected output when used:

WELCOME

Transformers can also be chained, like this:

{{ name.uppercased().suffixed(" to this app")}}

Which will transform the value using all transformers from left to right, producing:

WELCOME to this app

There are a plethora of transformers available for each supported data type. Note that transformers can only be used on the data type they are listed under. For example, uppercased() can only be used on String values while random() can be used on dictionaries and arrays.

String Transformers

Following string transformers are available:

Array Transformers

Following array transformers are available:

Dictionary Transformers

Following dictionary transformers are available:

Numeric Transformers

Following numeric transformers are available:

Support Transformers

Support transformers are special because can be used on any data type.

Following support transformers are available: