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
Service
Description
AddBooleanValueStreamEntry
Adds a boolean property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddDateTimeValueStreamEntry
Adds a date and time property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddImageValueStreamEntry
Adds an image property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddInfoTableValueStreamEntry
Adds an Infotable property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddIntegerValueStreamEntry
Adds an integer property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddLocationValueStreamEntry
Adds a location property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddLongValueStreamEntry
Adds a long value property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddNumberValueStreamEntry
Adds a number property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddStringValueStreamEntry
Adds a string property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddThingCodeValueStreamEntry
Adds a Thing Code property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddVec2ValueStreamEntry
Adds a specified vec2 (A collection of two numbers. For example, 2D coordinates x and y) property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddVec3ValueStreamEntry
Adds a specified vec3 (A collection of three numbers. For example, 3D coordinates x, y, and z) property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
AddVec4ValueStreamEntry
Adds a specified vec4 (A collection of four numbers. For example, 4D coordinates x, y, z, and w) property value into the value stream for the Thing. From ThingWorx 9.5 onwards, you may include quality info too.
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
QueryBooleanPropertyHistory
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. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryDateTimePropertyHistory
Queries the value stream entries for the specified datetime property values of the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryImagePropertyHistory
Queries the value stream entries for the specified image property values of the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryInfoTablePropertyHistory
Queries the value stream entries for the specified infotable property values within a date range for the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryIntegerPropertyHistory
Queries the value stream entries for the specified integer property values of the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryLocationPropertyHistory
Queries the value stream entries for the specified location property values of the Thing in a specified time range. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryLongPropertyHistory
Queries the value stream entries for the specified long property values of the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
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. From ThingWorx 9.5 onwards, you can filter value stream entries by quality and display the results with quality too.
QueryNumberPropertyHistory
Queries the value stream for the specified number property values of the Thing in a specified time range. From ThingWorx 9.5 onwards, you can filter by quality too.
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. From ThingWorx 9.5 onwards, you can filter value stream entries by quality and display the results with quality too.
QueryStringPropertyHistory
Queries the value stream for the specified string property values of the Thing in a specified time range. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryThingCodePropertyHistory
Queries the value stream entries for the specified thingcode (A numerical representation of a Thing containing a Domain ID and Instance ID) property values of the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryVec2PropertyHistory
Queries the value stream entries for the specified vec2 (A collection of two numbers. For example, 2D coordinates x and y) property values of the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryVec3PropertyHistory
Queries the value stream entries for the specified vec3 (A collection of three numbers. For example, 3D coordinates x, y, and z) property values of the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
QueryVec4PropertyHistory
Queries the value stream entries for the specified vec4 (A collection of four numbers. For example, 4D coordinates x, y, z, and w) property values of the Thing. From ThingWorx 9.5 onwards, you can filter by quality too.
SetPropertyLogging
Turns the logging on or off for a specified property.
SetValueStream
Sets the value stream for the Thing.
Was this helpful?