AFListData Class
- Last UpdatedJan 12, 2026
- 7 minute read
- PI System
- AF SDK 3.2.0
- Developer
The AFListData object is associated with a AFAttributeList
and is used to retrieve and set extended historical data for multiple attributes.
It is accessed through the Data property of an AFAttributeList.

Inheritance Hierarchy
SystemObject
OSIsoft.AF.DataAFListData
OSIsoft.AF.DataAFListData
Namespace: OSIsoft.AF.Data
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.2.0.7
Syntax
public class AFListData
Public Class AFListData Dim instance As AFListData
public ref class AFListData
type AFListData = class end
The AFListData type exposes the following members.
Methods
| Name | Description | |
|---|---|---|
| EndOfStream |
Get the end-of-stream value for each attribute in this list.
| |
| EndOfStreamAsync |
Returns an end-of-stream AFValue for each attribute in this list.
| |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
| FilteredSummaries |
This method, when supplied a filter expression that evaluates to true or false,
evaluates it over the passed time range. For the time ranges where the expression evaluates to true, the method calculates
the requested summaries on the source attribute.
| |
| GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| InterpolatedValue |
Returns a interpolated value for each attribute in this list based on the passed time.
| |
| InterpolatedValueAsync |
Returns an AFValue for each attribute in this list based on the passed time.
| |
| InterpolatedValues |
Retrieves interpolated values over the specified time range at the specified sampling interval.
| |
| InterpolatedValuesAtTimes |
Retrieves interpolated values at the specified times.
| |
| PlotValues |
Retrieves values over the specified time range suitable for plotting over the number of intervals (typically represents pixels).
| |
| RecordedValue |
Returns a recorded value for each attribute in this list based on the passed time and mode.
| |
| RecordedValueAsync |
Returns a recorded AFValue for each attribute in this list based on the passed time and mode.
| |
| RecordedValues |
Returns a list of compressed values for the requested time range
from the source provider.
| |
| RecordedValuesAtTimes |
Retrieves recorded values at the specified times.
| |
| RecordedValuesByCount |
This method returns a specified number of compressed values beginning at the requested start time in the direction specified.
| |
| ReplaceValues(AFTimeRange, IListAFValues) |
This method removes existing data for each AFAttribute within the specified AFTimeRange and
inserts the specified values.
| |
| ReplaceValues(AFTimeRange, IListAFValues, AFBufferOption) |
This method removes existing data for each AFAttribute within the specified AFTimeRange and
inserts the specified values.
| |
| Summaries |
Returns several summaries over a time range for each interval within the range for each AFAttribute in the list.
| |
| Summary |
Returns several summaries for a list of attributes over a single time range.
| |
| ToString | Returns a string that represents the current object. (Inherited from Object.) | |
| UpdateValues(IListAFValue, AFUpdateOption) |
Write, update, or remove a AFAttribute value for each AFValue
in the specified list.
| |
| UpdateValues(IListAFValue, AFUpdateOption, AFBufferOption) |
Write, update, or remove a AFAttribute value for each AFValue
in the specified list.
|
Remarks
This AFListData provides increased performance when operating on
a number of attributes at one time.
| This method, property, or class is not available in the legacy .NET 3.5 version of the SDK. |
Examples
// This example demonstrates how to update multiple values using // the AFListData.UpdateValues method // Get the Database and UOMs PISystems myPISystems = new PISystems(); PISystem myPISystem = myPISystems.DefaultPISystem; AFDatabase myDB = myPISystem.Databases.DefaultDatabase; UOM uomYard = myPISystem.UOMDatabase.UOMs["yard"]; UOM uomSqFoot = myPISystem.UOMDatabase.UOMs["square foot"]; UOM uomLiter = myPISystem.UOMDatabase.UOMs["liter"]; // Create the Element AFElement myElement = myDB.Elements.Add("MyElement"); AFAttribute myAttribute = myElement.Attributes.Add("MyAttribute"); myAttribute.Type = typeof(double); myAttribute = myElement.Attributes.Add("MyAttribute2"); myAttribute.Type = typeof(double); // Create List of Attributes and their new values AFTime newTime = new AFTime("T-1d", CultureInfo.CurrentCulture); AFAttributeList attrList = new AFAttributeList(); List<AFValue> newValues = new List<AFValue>(); Random randomValues = new Random(); // Create Dynamic Attribute to a PIPoint to Update PIServer piServer = PIServers.GetPIServers().DefaultPIServer; if (PIPoint.TryFindPIPoint(piServer, "MyTestPoint#1", out PIPoint point)) { myAttribute = new AFAttribute(point); myAttribute.DefaultUOM = uomLiter; myAttribute.ConfigString += ";ReadOnly=False"; attrList.Add(myAttribute); newValues.Add(new AFValue(myAttribute, randomValues.NextDouble(), newTime, uomLiter)); } if (PIPoint.TryFindPIPoint(piServer, "MyTestPoint#2", out point)) { myAttribute = new AFAttribute(point); myAttribute.DefaultUOM = uomYard; myAttribute.ConfigString += ";UOM=ft;ReadOnly=True"; attrList.Add(myAttribute); newValues.Add(new AFValue(myAttribute, randomValues.NextDouble(), newTime, uomYard)); } // Get some Attributes from the Element to Update myAttribute = myElement.Attributes["MyAttribute"]; attrList.Add(myAttribute); newValues.Add(new AFValue(myAttribute, 100, newTime, uomSqFoot)); myAttribute = myElement.Attributes["MyAttribute2"]; attrList.Add(myAttribute); newValues.Add(new AFValue(myAttribute, 200, newTime, null)); // Get the Current Values for the Attributes AFValues currentValues = attrList.GetValue(newTime); Console.WriteLine("Current Values:"); foreach (AFValue value in currentValues) { Console.WriteLine(" {0}: '{1} {2}' at '{3}'", value.Attribute, value.Value, value.UOM, value.Timestamp); } // Update the Attribute Values and Display any Errors AFErrors<AFValue> errors = AFListData.UpdateValues(newValues, AFUpdateOption.Replace); if (errors != null && errors.HasErrors) { Console.WriteLine("\nErrors returned from AFListData.UpdateValues:"); // Display Value errors if (errors.Errors != null && errors.Errors.Count > 0) { foreach (var item in errors.Errors) { Console.WriteLine(" AFValue '{0}': {1}", item.Key, item.Value); } } // Display error from the PI Data Archive if (errors.PIServerErrors != null && errors.PIServerErrors.Count > 0) { foreach (var item in errors.PIServerErrors) { Console.WriteLine(" AFValue '{0}': {1}", item.Key, item.Value); } } // Display PI System errors if (errors.PISystemErrors != null && errors.PISystemErrors.Count > 0) { foreach (var item in errors.PISystemErrors) { Console.WriteLine(" AFValue '{0}': {1}", item.Key, item.Value); } } } // Get the Updated Current Values for the Attributes currentValues = attrList.GetValue(newTime); Console.WriteLine("\nUpdated Current Values:"); foreach (AFValue value in currentValues) { Console.WriteLine(" {0}: '{1} {2}' at '{3}'", value.Attribute, value.Value, value.UOM, value.Timestamp); }