For the complete documentation index, see llms.txt. This page is also available as Markdown.

Action data sources

An action data source is a collection of records, scoped to an action.It is the action-scoped counterpart to runtime-only data sources in apps, and like an app data source it can be backed by an object class, an enumerated type, or a calendar.

An action data source exists only for the duration of the action run that declares it. Subsequent action nodes in the same run can read and write to it in the same way any data source in the platform is used, and it is discarded when the action completes.

Action data sources are useful for work that an action performs on a collection of object-class records — staging records before they are persisted, transforming records as they flow through an action, collecting results to return to the caller, or making enum values and time-period objects available to the action nodes that need them.

Creating an action data source

Action data sources are defined on their parent action, alongside action variables and action params. The authoring surface differs between flows and apps:

  • In a flow action, action data is configured on the Action data tab in the flow action editor.

  • In an app action, action data is configured under Action settings in the right-side panel.

Click Add Data Source and choose the backing:

  • Object class data source. Select the object class and a cardinality — One for a single record, Many for a collection. The object class determines the properties on each record.

  • Calendar data source. Set a From datetime, a To datetime, and a Resolution. The data source generates one object per time period in the range. Object Class is Calendar and Cardinality is Many. For the properties available on each calendar object, see Calendar data sources.

  • Enumerated type data source. Select the enum. Cardinality is Many. The data source exposes the enum's values to the action.

Using an action data source

As the way to work with object classes from a flow. Flows run on the server and do not have access to app-level data sources, so action data sources are the only mechanism for creating, reading, updating, or persisting object class records from within a flow. Any flow that needs to interact with its solution's database through its object classes does so via an action data source.

As a persistence target. Records on an action data source are written to the database with the Persist Objects action node.

As intermediate collection state. An action can read, filter, transform, and write against an action data source in the same way an app action would work with an app data source.

Returning an action data source from an action

An action data source can be marked return from action, which makes it available to the caller as an output. When the caller — for example, a Run Flow or Run Action node — invokes the action, the returned data source is mapped into a data source in the calling context, either another action data source or an app data source. The mapping UI and its options are documented on the reference pages for Run Flow and Run Action.

A returned action data source can additionally be marked Streamable. When the caller is the Run Flow action node, writes to the data source during the action's run are delivered to the caller's mapping as they occur, instead of only when the action completes. If the called action fails, any partial writes are reverted, so a failed run still writes nothing.

Reference data sources

By default, a reference property on an action data source resolves only its display value. To bind into the properties of the referenced object (a deep-data binding), declare a reference data source for that property. The reference data source tells the platform which other data source on the action holds the referenced objects, so the reference can be resolved and its properties browsed and bound to, the same way as on an app data source.

A reference data source is declared per reference property, and its target must be an action data source on the same action, backed by the reference property's object class. Deep-data bindings on an action data source resolve in memory from data already loaded on the action, so a data source on a different action or at the app level cannot be used as the target.

Good to know

If a declared reference data source cannot resolve, the binding shows a warning. This happens when the target data source has been deleted, its object class does not match the reference property, or it is not on the same action. In the last case, the reference still resolves its display value, but the deep-data binding does not.

Properties

Property
Description

Name

A descriptive name.

Object Class

The object class that backs the data source. Determines the properties available on each record. For calendar data sources, this is read-only and always Calendar.

Enumerated Type

Enumerated type data source. The enum that backs the data source.

Cardinality

Whether the data source holds a single record (One) or a collection of records (Many). For calendar and enumerated type data sources, Many is the only option.

From

Calendar data source. The start of the calendar period.

To

Calendar data source. The end of the calendar period.

Resolution

Calendar data source. The length of each time period generated — Year, Quarter, Month, Week, Day, or Hour.

Auto Create

Object class data source with cardinality One. Automatically create an object in the data source when the action starts.

Runtime Properties

Add runtime properties to the action data source. These are calculated or temporary properties that exist only at runtime, in the same way as runtime properties on app data sources.

Description

A longer description of the action data source. For your own reference.

Return from Action

Object class data source. Make the action data source available to the caller as an output. See Returning an action data source from an action.

Streamable

Available if Return from Action is enabled. Deliver mid-action writes to the caller incrementally during the action run instead of only at the end. See Returning an action data source from an action.

Last updated

Was this helpful?