Data transforms in offline mode

Offline-enabled mobile apps support an extensive use of data transforms. With data transforms, you can save time and improve the developer experience by reducing the need for writing custom JavaScript functions.

Packaging

To use data transforms in an offline-enabled app, Pega Platform packages data transforms that match the supported features on the server. The packaging process converts the logic in the data transform to an equivalent JavaScript code on the client.

By default, the system packages the data transforms that you configure in the following components:

  • Flow connectors
  • Flow actions as preprocessing or postprocessing data transforms
  • Refresh actions in controls
  • Data transform actions (in either the primary page context or another page context) in controls

The structure of the packaged data transforms resembles the original model of the data transform and contains only the elements that are relevant for offline-enabled apps. If a data transform matches an unsupported scenario, the offline-enabled app does not process the data transform and the system logs an error.

If an offline-enabled app runs the data transform by using a Run script action or a custom JavaScript function, the system does not automatically package the data transform. You can add these types of data transform rules to the list of offline-supported data transforms to enable their use in offline-enabled apps.

Supported elements of data transforms

Offline-enabled apps support the following actions for data transforms:

  • Set
  • Update page
  • Append to
  • Append and map to
  • Remove
  • When
  • Otherwise when
  • Otherwise
  • Sort
  • Comment
  • Apply data transform
  • Exit data transform
  • For each page in
  • Exit for each

Unsupported scenarios

Offline-enabled apps do not support data transforms in the following scenarios:

  • A source field contains the at sign (@) outside of the quotation marks (" ").

    Library functions are not supported in offline mode. Configure the source field to contain expressions such as plus (+) or spaces as an alternative solution.

  • A condition contains the at sign (@).

    Library functions are not supported in offline mode. Use client-side expressions as an alternative solution.

  • A condition does not contain a dot (.).

    Server-side when conditions are not supported in offline mode. Use client-side expressions as an alternative solution.

  • Parameter pages and list-related keywords, such as APPEND, INDEX, LAST, are not supported in offline mode.