Data attribute references to other elements
- Last UpdatedMay 21, 2025
- 3 minute read
- PI System
- PI Server 2024 R2
- PI Server
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 |
|
Obtains the value of the first referenced element that is assigned to the category. |
|
@Description |
|
Obtains the value of the first referenced element that has the description. |
|
@Index |
|
Obtains the value of the third referenced element. |
|
|
Obtains the value of the attribute from the second referenced element. |
|
|
@Name Note: You can use wild cards with @Name. |
|
Obtains the value of the element named . |
|
|
Obtains the value of the attribute from the first referenced element whose name ends in . |
|
|
@ReferenceType |
|
Obtains the value of the first referenced element that uses the reference type. |
|
@Template |
|
Obtains the value of the first referenced element that uses the template. |
|
|
Obtains the value of the attribute that has the same name as this event frame attribute from the first referenced element that uses the . |
|
|
@Trait |
|
Obtains the value of the attribute with a trait in the first referenced element whose name begins with . |
|
@Type |
|
Obtains the value of the first attribute that has an value type in the first referenced element whose name begins with . |
|
@UOM |
|
Obtains the value of the first attribute that uses the unit of measure in the first referenced element whose name begins with . |
Examples that combine collection filters
You can also combine collection filter criteria, as shown in the following examples:
|
Example |
Explanation |
|---|---|
|
|
Obtains the value of the attribute from the first referenced element whose name ends in and whose element category is . |
|
|
Obtains the value of the attribute from the first referenced element whose name starts with and whose element template is . |
|
|
Obtains the value of the attribute from the first child event frame whose template is . |
|
or
|
Obtains the value of the attribute from the most recent child event frame whose template is . 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:
.\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