cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Convert Valuestream to an Infotable

RS_9963079
7-Bedrock

Convert Valuestream to an Infotable

Hi,

I am currently pushing data up to ThingWorx Composer via an API call which is being stored in a valuestream. Is there any way to convert all this data into an infotable that I can call while writing services? 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
abjain
13-Aquamarine
(To:RS_9963079)

@RS_9963079 : You can use querypropertyhistory service at Thing level which gives you value stream data. If you specifically want to assign it to an infotable property than just assign the result to the property

Ex:

var result = Things["thingname"].QueryPropertyHistory({
oldestFirst: undefined /* BOOLEAN */,
maxItems: undefined /* NUMBER */,
endDate: undefined /* DATETIME */,
query: undefined /* QUERY */,
startDate: undefined /* DATETIME */
});
me.infitc=result;

View solution in original post

3 REPLIES 3
abjain
13-Aquamarine
(To:RS_9963079)

@RS_9963079 : You can use querypropertyhistory service at Thing level which gives you value stream data. If you specifically want to assign it to an infotable property than just assign the result to the property

Ex:

var result = Things["thingname"].QueryPropertyHistory({
oldestFirst: undefined /* BOOLEAN */,
maxItems: undefined /* NUMBER */,
endDate: undefined /* DATETIME */,
query: undefined /* QUERY */,
startDate: undefined /* DATETIME */
});
me.infitc=result;

Thanks so much! Can I ask for an example of an appropriate parameter for "query"? Would it be okay to leave it undefined?

abjain
13-Aquamarine
(To:RS_9963079)

@RS_9963079 : Its an optional parameter and need not require to be provided. You can try this service on any thing which has value stream associated and properties 'logged'.

Top Tags