Learn about path syntax for filters
- Last UpdatedDec 18, 2024
- 1 minute read
- PI System
- PI Server 2024 R2
- PI Server
A collection filter starts with the at sign (@) followed by the filter name. Supported filters are: , , , , , , , , and .
You must enclose the filter specification in square brackets ([ and ]).
You can also specify multiple filters; they are evaluated in the order specified. For example:
\\MySystem\MyDatabase\Elements[@Template=Tank][@Category=Tutorial]|Attributes[@Category=Tutorial]
Category filter example
The following example returns the Volume attribute from all elements in the category, Tutorial, that belong to the database called MyDatabase:
\\MySystem\Databases[MyDatabase]\Elements[@Category=Tutorial]|Volume
Type filter example
The following example returns the attributes of Element1 that are of Int32 type:
\Element1|Attributes[@Type=System.Int32]
Unit of measure filter example
The following example returns the attributes of Element1 that have meters as their unit of measure:
\Element1|Attributes[@UOM=meter]
Index filter example
Use the index filter or to specify the position of the matched object to return (the first item is at index position 1). The index filter must be the last filter specified. The following example returns the third database in the collection of PI AF databases in the current system:
\\Systems[MySystem]\Databases[@Index=3]
Beginning with PI AF 2017, you can use a negative number for an index from the end of the collection (for example -1 indicates the last item, -2 indicates the penultimate item).
\Element#1\Elements[@Name=Tank*][@Index=-3]
The index filter name is optional if another filter is specified before the index filter. For example:
\Element#1\Elements[@Name=Tank*][3]