ThingWorx Model Definition in Composer > Data Storage > Value Streams > Accessing Value Stream Data Using Services
Accessing Value Stream Data Using Services
The following value stream services are available via a Thing or Thing Template. Data must be accessed through the Thing that uses the value stream.
You can retrieve value stream entries in a variety of ways using the provided services. For example, entries can be retrieved by a specific logged property (QueryBooleanPropertyHistory, (QueryDateTimePropertyHistory), a set of logged properties (QueryNamedPropertyHistory), or all logged properties (QueryPropertyHistory).
When retrieving multiple properties, ThingWorx runs a special algorithm to ensure a full table that is in sync with no nulls is returned. For example, if one property is logged more often than another property, ThingWorx fills in the blanks if both properties are retrieved at once.
Value stream data is not deleted unless the Thing that created the data explicitly purges the data or the value stream is deleted. Data remains intact if the originating Thing or property is deleted.
* 
When switching the persistence provider of a value stream (for example, from ThingworxPersistenceProvider to PostgreSQL or InfluxDB), any Thing that implements a value stream must call the RestartThing service to retrieve entries written to the new persistence provider. If the Things are not restarted, entries may be written to the database; however, they will not be retrieved until the Thing is restarted.
Value Stream Services
GetLoggedProperties
Returns a list of the Thing’s properties marked for value stream logging.
GetNumericLoggedProperties
Returns a list of properties for a specified numeric base type.
GetPropertyLogging
Determines if a property is being logged.
GetValueStream
Returns the name of the value stream assigned to the Thing.
PurgePropertyHistory
Deletes all value stream entries for a property within the specified date range.
QueryBooleanPropertyHistory
Queries the value stream entries for the specified boolean property values within a date range for the Thing.
QueryDateTimePropertyHistory
Queries the value stream entries for the specified datetime property values of the Thing.
QueryImagePropertyHistory
Queries the value stream entries for the specified image property values of the Thing.
QueryInfoTablePropertyHistory
Queries the value stream entries for the specified infotable property values within a date range for the Thing.
QueryIntegerPropertyHistory
Queries the value stream entries for the specified integer property values of the Thing.
QueryLocationPropertyHistory
Queries the value stream entries for the specified location property values of the Thing in a specified time range.
QueryNamedPropertyHistory
Queries the value stream entries for a specified logged property value, along with filter and sort criteria, and normalizes the data set to display results for a given time range.
QueryNumberPropertyHistory
Queries the value stream for the specified number property values of the Thing in a specified time range.
Queries the value stream for logged property values, along with filter and sort criteria, and normalizes the data set to display results for a given time range.
QueryStringPropertyHistory
Queries the value stream for the specified string property values of the Thing in a specified time range.
SetPropertyLogging
Turns the logging on or off for a specified property.
SetValueStream
Sets the value stream for the Thing.
Was this helpful?