Constant

Value resolver – Abstract

Purpose: Returns the value of a System constant defined for the current instance of the Lobster Data Platform server.

images/download/attachments/201661994/image-2025-3-13_14-44-39-version-1-modificationdate-1741873478495-api-v2.png

The Constant value resolver returns the value of a System constant defined for currently used instance of the Lobster Data Platform server.

  • The Constant name parameter must define the name of a system constant in the embedded _data by direct input of static text or by configuring value resolvers.

  • If the System constant addressed by the Constant name parameter is unknown in the current server instance, the return value is 'No value' ($null).

By definition, the value of a constant is always a string. Other data types can, as shown in the examples, be 'encoded' as a string (e.g. in JSON format) if necessary, which is converted back into an object during read access.

NOTE◄ It is possible to define system constants with matching names but differing values for different Lobster Data Platform instances (e.g. for a 'live' and a 'test' system). This approach can be used to distinguish or identify the systems in the automation context. Moreover, specific content (e.g. URLs or mail addresses) can also be stored for each 'environment'.

IMPORTANT◄ This value resolver is not available in a Client workflow.

Configuration

The Constant value resolver ignores the input value. However, it is available for value resolvers in the Constant name parameter.

The Constant name parameter identifies the constant whose value is read by default by the direct input of static text which must match the name of the constant (incl. upper/lower case).

images/download/attachments/201661994/image-2025-3-13_14-45-7-version-1-modificationdate-1741873506680-api-v2.png

This configuration returns the value of the system constant which can be stored in Lobster_data e.g. as shown below:

images/download/attachments/201661994/image-2025-3-13_14-55-31-version-1-modificationdate-1741874130475-api-v2.png

After clicking on the small gray arrow (in the lower left corner of the text field for direct input, see above), a Constant name parameter can be defined to 'build up' a text value at runtime, which must correspond to the name of a constant (incl. upper/lower case).

The configuration on the right concatenates a static text with the internal name for the Current locale ('without country', see 'Examples' for details), so that one of the following constants is 'read':

images/download/attachments/201661994/image-2025-3-13_14-47-15-version-1-modificationdate-1741873634664-api-v2.png

images/download/attachments/201661994/image-2025-3-13_14-56-12-version-1-modificationdate-1741874172056-api-v2.png

Examples

Simple use case: Globally defined sender address for e-mails 'from the system'

For e-mails sent by Lobster Data Platform / Orchestration, a default sender address should be applied, which is defined as the value of a System-Konstante (EMAIL_FROM_DEFAULT):

images/download/attachments/201661994/image-2025-3-13_14-55-31-version-1-modificationdate-1741874130475-api-v2.png

Configuration:

In the configuration for a E-Mail event action shown on the right, the From tab uses the Constant value resolver to determine the sender:

  • The Constant name is defined by direct input as static text EMAIL_FROM_DEFAULT.

  • The sender in the example (see above) is: noreply@doma.in

images/download/attachments/201661994/image-2025-3-13_14-45-54-version-1-modificationdate-1741873554282-api-v2.png

More complex use case: Assigning an e-mail receiver for the Current locale

In certain scenarios, an e-mail to a support address is to be generated automatically in the context of a portal provided by Lobster Data Platform / Orchestration.

Specific support addresses for selected languages are stored via system constants in Lobster_data:

images/download/attachments/201661994/image-2025-3-13_14-56-12-version-1-modificationdate-1741874172056-api-v2.png

At runtime, the program checks whether a specific support address is stored as a constant for the Current locale. If this is not the case, an address statically defined in the code is assigned as the recipient.

NOTE◄ Alternatively, the Localization of Lobster Data Platform / Orchestration for a language-dependent assignment of a support address is also a good idea.

Configuration:

In the configuration for a E-Mail event action shown on the right, the (first) recipient is determined in the Recipient tab as follows:

  • The Constant value resolver builds a Constant name per Concat strings from a static prefix EMAIL_TO_SUPPORT and the internal name for the Current locale. If a country-specific Locale is current (e.g. de_CH), the Country component (e.g. CH) is ignored. The name of the language is added to the prefix here Upper case, so that constant names are created as shown above.

  • The concatenated Default value resolver is intended to cover any cases where the constant addressed by Constant name does not exist or returns an empty string. In both cases, the Default value defined as static text support@doma.in is assigned as the recipient address.

images/download/attachments/201661994/image-2025-3-13_14-47-58-version-1-modificationdate-1741873677605-api-v2.png

Special use case: Providing a global value list for access via index

Lobster Data Platform / Orchestration offers Dynamic enumerations for the management of predefined and user-defined value lists, which support, among other things, a separation of the key value and label via Localization and, if necessary, Company specific localization.

However, a value list can serve the sole purpose of arranging specific values in a particular order, e.g. to make them addressable via the index position in the list. For this use, a value list can also be provided as a string in a system constant, which is only converted into a real list on access (by Lobster Data Platform / Orchestration).

The following examples illustrate the procedure.

Example: For a limited integer value range (here: 1-25) a conversion of index values into 'Roman numerals' is supported, e.g. to be able to output a sequence number (version, bullet, etc.) given as a long value in this format.

A system constant ROMAN_NUMERALS is created in Lobster_data, and the following string is assigned to it as a value.:
,i,ii,iii,iv,v,vi,vii,viii,ix,x,xi,xii,xiii,xiv,xv,xvi,xvii,xviii,xix,xx,xxi,xxii,xxiii,xxiv,xxv

images/download/attachments/201661994/image-2025-3-13_14-58-0-version-1-modificationdate-1741874280396-api-v2.png

Configuration:

A text value should identify the incrementally determined version number of a type in conjunction with the prefix 'Mk' ('Mark').

In a Concat strings value resolver, the following text components are concatenated:

  • The first text component is the statically determined prefix Mk in conjunction with an added space character.

  • The second text component translates the version number of the versionIndex variable into 'Roman numerals':

    • The Constant value resolver returns the string seen above as a comma-separated list of combinations of Roman numeral characters for the numbers 1 to 25. Since there is no Roman numeral character for the value 0, the string starts with a comma, so the text 'i' takes the index position 1 of a list.

    • The concatenated Split text value resolver generates a list of text values from the text of the constants, using the comma as a Delimiter (separator).

    • The concatenated List item value resolver accesses the value of the list whose index position ('counted from the beginning' of the list) corresponds to the value of the variable versionIndex. The 'Roman numeral' looked up by index is added to Upper case.

images/download/attachments/201661994/image-2025-3-13_14-53-41-version-1-modificationdate-1741874020987-api-v2.png

Runtime example: (Output of the version designation with versionIndex = 7 in a notification message).

images/download/attachments/201661994/image-2025-3-13_14-38-16-version-1-modificationdate-1741873096238-api-v2.png