Data Sources: Sources[ … ]

Use to get or set a named data source.
The purpose of the named data source is to make it possible to work with data sources in more advanced scenarios than those available with the standard Action Commands. Examples of this could be:

  • Creating new data sources

  • Advanced manipulation of data sources

  • Doing look-ups in multiple other data sources.

All data sources in scope stored in Sources[] can be seen as data souces in the Action Debugger.

Syntax

object Sources[string sourceName] {get;set} Sources.Set(string sourceName, object dataSource) Sources.TryGetValue(string sourceName, object dataSource)

Method Parameters

string
sourceName

Name of the data source

object

dataSource

The data source. This can be any data type including .Net DataTables, Strings, Numbers or Binary files

 

Scope & Usage

By default, data sources are available within the scope of the Action that defines them. When working with Actions, the names defined in the TO column of Action Commands are created as data sources, containing the output of the Action Command.

A data source global by adding “$” in front of the name. Making a data source global makes it available anywhere in the currently running Actions, including sub Action started with EXECUTE.ACTION or EXECUTE.ACTION.LOOP and in any parent Action that has executed the current Action.

See Use Global Table To Retrieve Data From Loop for an example on how to use a global data source.

While Sources can be used to store variables, it is recommended to only use it for data source that should be manipulated using standard Action Commands. Please see the article on Variables for how to work with variables within Actions Variable: var[ … ] .