Bridging Dataset and Expression References

Every Bridging activity exposes its result as a dataset, and almost every field of an activity can be an expression rather than a fixed value.

Expressions use the GENESIS expression engine, so all standard operators and functions are available in addition to the references below. Learn more

Dataset Structure

Rows and columns are zero-based, and reader activities always return a dataset, even when they read a single value. A Real Time Input Activity reading one tag, for example, returns one row where column 0 is PointName and column 1 is Value.

Select an activity in the Template Designer and look at its Data Schema section to see the exact column names and order that the activity will produce.

Activity Output References

Use these references to read a cell from the dataset of another activity in the same diagram.

Reference

Description

{{PrevActivityOutput:Row[<index>].Col[<indexOrName>]}}

A cell from the output dataset of the activity immediately preceding the current one.

{{PrevActivityOutput:RowCount}}

The number of rows in the preceding activity's output dataset.

{{ActivityOutput:<activityName>.Row[<index>].Col[<indexOrName>]}}

A cell from the output dataset of a named activity anywhere earlier in the diagram.

{{ActivityOutput:<activityName>.RowCount}}

The number of rows produced by a named activity.

{{column:<columnName>}}

The value of a column in the row currently being processed. Valid only in the fields of an activity that iterates over an input dataset, such as a Data Filter expression or a bulk writer's parameter expression.

Because activity names are used in these references, give every activity a meaningful, unique name. A duplicate name is reported in the Validation Log.

Example 1: Copy the value read by the preceding activity into the output of a Real Time Output Activity.

x={{PrevActivityOutput:Row[0].Col[1]}}

Example 2: Filter a Dataset Reader Activity so that only rows for one country are passed downstream.

x=like({{column:ShipCountry}}, "USA", 0)

Example 3: Build an event message from a named activity's dataset.

x="Order " + {{ActivityOutput:Orders.Row[0].Col[0]}} + " shipped to " + {{ActivityOutput:Orders.Row[0].Col[9]}}

Dynamic Dataset Functions

The references above require the row index to be known when you write the expression. When the row is determined at runtime—by a counter or by a lookup—use these functions instead.

Function

Description

getoutputcell(<activityName>, <rowIndex>, <columnIndexOrName>)

Returns the scalar value of one cell of the named activity's output dataset.

getoutputrow(<activityName>, <rowIndex>)

Returns an array containing the values of all columns of the specified row.

findoutputrow(<activityName>, <rowFilter>)

Returns an array containing the values of all columns of the first row that matches the filter.

findoutputcell(<activityName>, <rowFilter>, <columnIndexOrName>)

Returns one cell of the first row that matches the filter.

findoutputrowindex(<activityName>, <rowFilter>)

Returns the index of the first row that matches the filter, or -1 when no row matches.

The rowFilter argument uses the same syntax as ADO.NET DataTable row filtering.

Example 1: Read a cell whose row index comes from a local variable acting as a counter.

x="City " + getoutputcell("Orders", {{bwx:local@Counter.Row[0].Col[0]}}, 10)

Example2: Look up a row by content instead of by position.

x=findoutputcell("Orders", "OrderID=11077", "CustomerID")

Example 3: Combine a lookup with a cell read.

x=getoutputcell("Orders", findoutputrowindex("Orders", "OrderID=11077"), 10)

Variable References

Variables are addressed through the bwx: point manager and can be read in an expression or written to by an output activity. Learn more

Reference

Description

bwx:global@<name>.Row[<index>].Col[<indexOrName>]

A cell of a global variable.

bwx:local@<name>.Row[<index>].Col[<indexOrName>]

A cell of a local variable, private to the running transaction instance.

Example: Decrement a counter held in a local variable.

x={{bwx:local@Counter.Row[0].Col[0]}} - 1

Parameter and Trigger References

Reference

Description

<<name>>

The value of a template parameter for the running instance. Note that a parameter is enclosed in double angle brackets rather than the double braces used by the other references. Parameters appear under Parameters in the expression editor's list of available variables. Learn more

{{triggerVariable:<attribute>}}

An attribute of the trigger or alarm that started the transaction, such as {{triggerVariable:SourceName}}. Learn more

Any other GENESIS data point can also be read in a Bridging expression using its normal point name—for example, {{ac:Plant/Pump1/Flow}} for an asset property or {{modbus:Heater.Temperature}} for a device tag.

Message Text Shortcuts

The message fields of the notification and event activities—Send Email Activity, Send SMS Activity, Audit Event Output Activity, NT Event Output Activity, and the other alerting activities—accept the following shortcuts in addition to expressions.

Shortcut

Resolves to

/T

Current transaction name

/C

Current activity name

/D

Current activity description

/L

Last executed activity name

/E

Last error

/B

Activity in which the last error occurred

Example message text for a failure branch:

Transaction /T failed at activity /B with error: /E