Skip to content

Property evaluation

HCaseira edited this page Dec 11, 2023 · 1 revision

A value of a property can be a reference to objects within an evaluation context.

String evaluation occurs upon building a Widget or an Action, in which each of the Node's properties will be sanitized.

How to refer to an object

An object can be refered using a syntax like ${state.address}. In this case we're referring to the key address of the Screen's state Map.

What objects exist during evaluation

Some of the objects are:

  • env: refers to the Model's environment variables, managed in the editor. E.g. ${env.api_url}.

  • global: refers to a static Map accessible via Lowder.globalVariables where global key/value pairs can be stored, like the user's profile or an access token. E.g. ${global.user.name}.

  • state: refers to a Map each Screen has where its state is stored. E.g. ${state.email}.

  • media: a Map containing some media properties like isWeb, isMobile, isAndroid, portrait, etc.

  • entry: available only when working with a List, where upon building each row, the entry object will be available referring to an element of the array of data. ${entry.firstName} ${entry.lastName}.

Feel free to make your own objects available during evaluation by overriding the method getEvaluatorContext of the PropertyFactory.