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

AF SDK Reference

AFElement.FindElementsByExtendedProperty Method (AFDatabase, String, IEnumerable(Guid), Int32)

AFElement.FindElementsByExtendedProperty Method (AFDatabase, String, IEnumerable(Guid), Int32)

  • Last UpdatedNov 18, 2025
  • 4 minute read
AFElement.FindElementsByExtendedProperty Method (AFDatabase, String, IEnumerable(Guid), Int32)
Retrieves a list of AFElement objects that have the specified extended property Guid values defined for the element.

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public static IList<KeyValuePair<Guid, AFElement>> FindElementsByExtendedProperty(
	AFDatabase database,
	string propertyName,
	IEnumerable<Guid> values,
	int maxCount
)
Public Shared Function FindElementsByExtendedProperty ( 
	database As AFDatabase,
	propertyName As String,
	values As IEnumerable(Of Guid),
	maxCount As Integer
) As IList(Of KeyValuePair(Of Guid, AFElement))

Dim database As AFDatabase
Dim propertyName As String
Dim values As IEnumerable(Of Guid)
Dim maxCount As Integer
Dim returnValue As IList(Of KeyValuePair(Of Guid, AFElement))

returnValue = AFElement.FindElementsByExtendedProperty(database, 
	propertyName, values, maxCount)
public:
static IList<KeyValuePair<Guid, AFElement^>>^ FindElementsByExtendedProperty(
	AFDatabase^ database, 
	String^ propertyName, 
	IEnumerable<Guid>^ values, 
	int maxCount
)
static member FindElementsByExtendedProperty : 
        database : AFDatabase * 
        propertyName : string * 
        values : IEnumerable<Guid> * 
        maxCount : int -> IList<KeyValuePair<Guid, AFElement>> 

Parameters

database
Type: OSIsoft.AFAFDatabase
The AFDatabase to search for the requested objects.
propertyName
Type: SystemString
The name of the extended property to be searched.
values
Type: System.Collections.GenericIEnumerableGuid
The list of extended property values to match for the specified propertyName.
maxCount
Type: SystemInt32
The maximum number of elements to be returned from the search.

Return Value

Type: IListKeyValuePairGuid, AFElement
Returns a list of KeyValuePairTKey, TValue items where the key is the value of the extended property and the value is the AFElement that matched the search for that key value. This allows the returned element to be matched with the specified extended property value without needing to load the full object from the server.

Remarks

This method will find the elements that have an extended property with the specified propertyName and its value set to one of the values in the list of specified values. All extended property values of type String and Guid on an AFElement are automatically indexed in the server to speed up the search on these types of property values. These are the only type of property values that can be searched. The QueryDate of the specified database will be used to determine the collection of elements that are returned from this method.

Note Notes to Callers
Only elements that have been saved to the server will be returned by this search. This search is only supported on PI AF Server 2.6 or later.

Important note Important
Consider using the new AFElementSearch class for finding elements instead of using this method.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8, 2.7.5, 2.7, 2.6

See Also

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