ThingWorx Model Definition and 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 DataStax Enterprise 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.
* 
When filtering stream data from DSE value streams, the end date is not inclusive. For example, if you query entries and set the end date to the exact timestamp of the last entry, the last entry will not be included in your results.
Value Stream Services
* 
PurgeAllPropertyHistory, PurgeSelectedPropertyHistory, and PurgePropertyHistory are not supported services if you are using InfluxDB as your persistence provider.
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 each specified property value in the list of properties of the given source thing in a given time range
QueryNumberPropertyHistory
Queries the value stream for the specified number property values of the thing in a specified time range
QueryPropertyHistory
Queries the value stream for each logged property value of the thing in a specified 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