AFNameSubstitutionType Enumeration
- Last UpdatedNov 18, 2025
- 7 minute read
- PI System
- AF SDK 2024 R2
- Developer
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public enum AFNameSubstitutionType
Public Enumeration AFNameSubstitutionType Dim instance As AFNameSubstitutionType
public enum class AFNameSubstitutionType
type AFNameSubstitutionType
Members
| Member name | Value | Description | |
|---|---|---|---|
| None | 0 | Indicates that no substitution type is specified. | |
| Time | 1 | %TIME:yyyy-MM-dd HH:mm:ss.fff%: Replaced with the current local DateTime using the specified formatting. If no formatting is specified, then the default formatting will be used. The formatting uses the standard format strings supported by the DateTime.ToString method. | |
| UtcTime | 2 | %UTCTIME:yyyy-MM-dd HH:mm:ss.fff%: Replaced with the current Coordinated Universal Time (UTC) DateTime using the specified formatting. If no formatting is specified, then the default formatting will be used. The formatting uses the standard format strings supported by the DateTime.ToString method. | |
| StartTime | 3 | %STARTTIME:yyyy-MM-dd HH:mm:ss.fff%: Replaced with the current local StartTime using the specified formatting. If no formatting is specified, then the default formatting will be used. The formatting uses the standard format strings supported by the DateTime.ToString method. | |
| UtcStartTime | 4 | %UTCSTARTTIME:yyyy-MM-dd HH:mm:ss.fff%: Replaced with the current Coordinated Universal Time (UTC) StartTime of the object using the specified formatting. If no formatting is specified, then the default formatting will be used. The formatting uses the standard format strings supported by the DateTime.ToString method. | |
| EndTime | 5 | %ENDTIME:yyyy-MM-dd HH:mm:ss.fff%: Replaced with the current local EndTime of the object using the specified formatting. If no formatting is specified, then the default formatting will be used. The formatting uses the standard format strings supported by the DateTime.ToString method. | |
| UtcEndTime | 6 | %UTCENDTIME:yyyy-MM-dd HH:mm:ss.fff%: Replaced with the current Coordinated Universal Time (UTC) EndTime of the object using the specified formatting. If no formatting is specified, then the default formatting will be used. The formatting uses the standard format strings supported by the DateTime.ToString method. | |
| Duration | 55 | %DURATION:d.hh:mm:ss.fffffff%: Replaced with the current local Duration using the specified formatting. If no formatting is specified, then the default formatting will be used. The formatting uses the standard format strings supported by the TimeSpan.ToString method. | |
| System | 7 | %SYSTEM%: Replaced with the name of the object's PISystem (PI AF Server). | |
| SystemID | 8 | %SYSTEMID%: Replaced with the ID of the object's PISystem (PI AF Server). | |
| Server | 9 | %SERVER%: Replaced with the name of the current default PIServer on the client. | |
| Database | 10 | %DATABASE%: Replaced with the name of the object's AFDatabase. | |
| DatabaseID | 11 | %DATABASEID%: Replaced with the ID of the object's AFDatabase. | |
| Name | 56 | %NAME:path%: Replaced with the object's name represented by the path to the object. If the path is not specified, then will be returned since it would be referencing the the name of the current object. | |
| ID | 12 | %ID:path%: Replaced with the object's ID represented by the path to the object. If the path is not specified, then the ID of the current object is used. | |
| Description | 13 | %DESCRIPTION:path%: Replaced with the object's Description represented by the path to the object. If the path is not specified, then the description of the current object is used. | |
| Template | 14 | %TEMPLATE%: Replaced with the name of the object's template. | |
| ParentTemplate | 15 | %..\TEMPLATE%: Replaced with the name of the parent template of the object's AFElement or AFEventFrame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\TEMPLATE%'. | |
| RootTemplate | 16 | %\TEMPLATE%: Replaced with the name of the root template of the object's AFElement or AFEventFrame. | |
| Analysis | 17 | %ANALYSIS%: Replaced with the name of the object's AFAnalysis. | |
| AnalysisID | 18 | %ANALYSISID%: Replaced with the ID of the object's AFAnalysis. | |
| Attribute | 19 | %ATTRIBUTE%: Replaced with the name of the object's AFAttribute or AFAttributeTemplate. | |
| AttributeID | 20 | %ATTRIBUTEID%: Replaced with the ID of the object's AFAttribute or AFAttributeTemplate. | |
| AttributeValue | 57 | %@path%: Replaced with the value of the object's AFAttribute or AFAttributeTemplate represented by the path. | |
| ParentAttribute | 21 | %..|ATTRIBUTE%: Replaced with the name of the object's parent AFAttribute or AFAttributeTemplate. Further ancestors can be retrieved by using the '..|' notation such as '%..|..|ATTRIBUTE%'. | |
| ParentAttributeID | 22 | %..|ATTRIBUTEID%: Replaced with the ID of the object's parent AFAttribute or AFAttributeTemplate. Further ancestors can be retrieved by using the '..|' notation such as '%..|..|ATTRIBUTEID%'. | |
| ParentAttributeDescription | 23 | %..|DESCRIPTION%: Replaced with the Description of the object's parent AFAttribute or AFAttributeTemplate. Further ancestors can be retrieved by using the '..|' notation such as '%..|..|DESCRIPTION%'. | |
| RootAttribute | 24 | %|ATTRIBUTE%: Replaced with the name of the object's root AFAttribute or AFAttributeTemplate. | |
| RootAttributeID | 25 | %|ATTRIBUTEID%: Replaced with the ID of the object's root AFAttribute or AFAttributeTemplate. | |
| RootAttributeDescription | 26 | %|DESCRIPTION%: Replaced with the Description of the object's root AFAttribute or AFAttributeTemplate. | |
| Element | 27 | %ELEMENT%: Replaced with the name of the object's AFElement, or the name of the PrimaryReferencedElement of the object's AFEventFrame. | |
| ElementID | 28 | %ELEMENTID%: Replaced with the ID of the object's AFElement, or the ID of the PrimaryReferencedElement of the object's AFEventFrame. | |
| ElementDescription | 29 | %ELEMENTDESCRIPTION%: Replaced with the Description of the object's AFElement, or the Description of the PrimaryReferencedElement of the object's AFEventFrame. | |
| ElementPath | 30 | %ELEMENTPATH%: Replaced with the path of the AFBaseElement, the Element of an AFAttribute, or the PrimaryReferencedElement of an AFEventFrame. | |
| ParentElement | 31 | %..\ELEMENT%: Replaced with the name of the object's parent AFElement, or the name of the PrimaryReferencedElement of the object's parent AFEventFrame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\ELEMENT%'. | |
| ParentElementID | 32 | %..\ELEMENTID%: Replaced with the ID of the object's parent AFElement, or the ID of the PrimaryReferencedElement of the object's parent AFEventFrame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\ELEMENTID%'. | |
| ParentElementDescription | 33 | %..\ELEMENTDESCRIPTION%: Replaced with the Description of the object's parent AFElement, or the Description of the PrimaryReferencedElement of the object's parent AFEventFrame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\ELEMENTDESCRIPTION%'. | |
| ParentElementPath | 34 | %..\ELEMENTPATH%: Replaced with the path of the object's parent AFElement, or the path of the PrimaryReferencedElement of the object's parent AFEventFrame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\ELEMENTPATH%'. | |
| RootElement | 35 | %\ELEMENT%: Replaced with the name of the object's root AFElement, or the name of the PrimaryReferencedElement of the object's root AFEventFrame. | |
| RootElementID | 36 | %\ELEMENTID%: Replaced with the ID of the object's root AFElement, or the ID of the PrimaryReferencedElement of the object's root AFEventFrame. | |
| RootElementDescription | 37 | %\ELEMENTDESCRIPTION%: Replaced with the Description of the object's root AFElement, or the Description of the PrimaryReferencedElement of the object's root AFEventFrame. | |
| EventFrame | 38 | %EVENTFRAME%: Replaced with the name of the object's AFEventFrame. | |
| EventFrameID | 39 | %EVENTFRAMEID%: Replaced with the ID of the object's AFEventFrame. | |
| EventFrameDescription | 40 | %EVENTFRAMEDESCRIPTION%: Replaced with the Description of the object's AFEventFrame. | |
| EventFramePath | 41 | %EVENTFRAMEPATH%: Replaced with the path of the AFEventFrame or the Element of an AFAttribute of an event frame. | |
| ParentEventFrame | 42 | %..\EVENTFRAME%: Replaced with the name of the object's parent AFEventFrame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\EVENTFRAME%'. | |
| ParentEventFrameID | 43 | %..\EVENTFRAMEID%: Replaced with the ID of the object's parent event frame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\EVENTFRAMEID%'. | |
| ParentEventFrameDescription | 44 | %..\EVENTFRAMEDESCRIPTION%: Replaced with the Description of the object's parent event frame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\EVENTFRAMEDESCRIPTION%'. | |
| ParentEventFramePath | 45 | %..\EVENTFRAMEPATH%: Replaced with the path of the object's parent AFEventFrame. Further ancestors can be retrieved by using the '..\' notation such as '%..\..\EVENTFRAMEPATH%'. | |
| RootEventFrame | 46 | %\EVENTFRAME%: Replaced with the name of the object's root event frame. | |
| RootEventFrameID | 47 | %\EVENTFRAMEID%: Replaced with the ID of the object's root event frame. | |
| RootEventFrameDescription | 48 | %\EVENTFRAMEDESCRIPTION%: Replaced with the Description of the object's root event frame. | |
| Model | 49 | %MODEL%: Replaced with the name of the object's AFModel. | |
| ModelID | 50 | %MODELID%: Replaced with the ID of the object's AFModel. | |
| Transfer | 51 | %TRANSFER%: Replaced with the name of the object's AFTransfer. | |
| TransferID | 52 | %TRANSFERID%: Replaced with the ID of the object's AFTransfer. | |
| Source | 53 | %SOURCE%: Replaced with the name of the Source of the object's AFTransfer. | |
| Destination | 54 | %DESTINATION%: Replaced with the name of the Destination of the object's AFTransfer. |
Remarks
These are the type of substitutions that can be used when resolving an object's name using the AFNameSubstitution class or when configuring the AFElementTemplate.NamingPattern property. These types are also used in the AFDataReference.SubstituteParameters method used to resolve ConfigString parameters in some data reference implementations. The AFNameSubstitution.GetSubstitutionList method can be used to obtain a list of substitutions based upon AFNameSubstitutionFilters.
All of the time substitutions (e.g. Time, UtcTime, StartTime, UtcStartTime, EndTime, and UtcEndTime) allow a format string to be specified. It uses the standard format strings supported by the DateTime.ToString method. The format string is separated from the substitution name with a colon (':'). For example, '%TIME:d%' would use the short date pattern while '%UTCTIME:yyyy/MM/dd HH:mm:ss.fff%' fully specifies the format.