Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Asset Framework and PI System Explorer (PI Server 2024 R2)

Data attribute references to other elements

  • Last UpdatedMay 21, 2025
  • 3 minute read

In data references from an event frame template, you can reference other elements and attributes with collection filters and relative paths.

Examples that use collection filters

You can reference other elements and attributes with the collection filters shown in the following table.

Collection filter

Example

Explanation

@Category

.\Elements[@Category=MyCategory]

Obtains the value of the first referenced element that is assigned to the MyCategory category.

@Description

.\Elements[@Description=My Description]

Obtains the value of the first referenced element that has the My Description description.

@Index

.\Elements[@Index=3]

Obtains the value of the third referenced element.

.\Elements[@Index=2]|FlowRate

Obtains the value of the FlowRate attribute from the second referenced element.

@Name

Note: You can use wild cards with @Name.

.\Elements[@Name=Tank1]

Obtains the value of the element named Tank1.

.\Elements[@Name=*2]|FlowRate

Obtains the value of the FlowRate attribute from the first referenced element whose name ends in 2.

@ReferenceType

.\Elements[@ReferenceType=Area]

Obtains the value of the first referenced element that uses the Area reference type.

@Template

.\Elements[@Template=MyTemplate]

Obtains the value of the first referenced element that uses the MyTemplate template.

.\Elements[@Template=Pump Template]|%attribute%

Obtains the value of the attribute that has the same name as this event frame attribute from the first referenced element that uses the Pump Template.

@Trait

.\Elements[@Name=Tank*]|Attributes[@Trait=LoLo]

Obtains the value of the attribute with a LoLo trait in the first referenced element whose name begins with Tank.

@Type

.\Elements[@Name=Tank*]|Attributes[@Type=System.Int32]

Obtains the value of the first attribute that has an Int32 value type in the first referenced element whose name begins with Tank.

@UOM

.\Elements[@Name=Tank*]|[@UOM=meter]

Obtains the value of the first attribute that uses the meter unit of measure in the first referenced element whose name begins with Tank.

Examples that combine collection filters

You can also combine collection filter criteria, as shown in the following examples:

Example

Explanation

.\Elements[@Name=*2][@Category=Pump]|FlowRate

Obtains the value of the FlowRate attribute from the first referenced element whose name ends in 2 and whose element category is Pump.

.\Elements[@Name=Pump*][@Template=Pump Template]|FlowRate

Obtains the value of the FlowRate attribute from the first referenced element whose name starts with Pump and whose element template is Pump Template.

.\EventFrames[@Template=Machine Template]|Pressure

Obtains the value of the Pressure attribute from the first child event frame whose template is Machine Template.

.\EventFrames[@Template=Machine Template][@Index=-1]|Pressure

or

.\EventFrames[@Template=Machine Template][-1]|Pressure

Obtains the value of the Pressure attribute from the most recent child event frame whose template is Machine Template.

Note: Beginning with PI AF 2017, you can use a negative number for an index from the end of a collection (for example -1 indicates the last item, -2 indicates the penultimate item).

The @Index filter is optional if another filter is specified before the index filter.

Examples that use relative paths

You can use relative path syntax to navigate the Elements hierarchy from an event frame and obtain other attribute values. For example, suppose you have the following element hierarchy:

In an event frame that has Production Line 1 as the primary referenced element, you can obtain the value of the Price attribute that is assigned to the Unit 1 parent element with the following syntax:

A screenshot of an element hierarchy showing a primary referenced element named Production Line 1.

.\Elements[.]\..\|Price

If the Price attribute were two levels up the hierarchy, you would use:

.\Elements[.]\..\..|Price

You can obtain the value of the Inflow PI point attribute that is assigned to the Pump 1 child element with the following syntax:

.\Elements[.]\Pump 1|Inflow

If the Pump 1 child element were based on the Pump element template, you would use:

.\Elements[.]\[@Template=Pump]|Flow

In This Topic
TitleResults for “How to create a CRG?”Also Available in