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

Convert Valuestream to an Infotable

SOLVED
RS_9963079
5-Regular Member

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
12-Amethyst
(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
12-Amethyst
(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

RS_9963079
5-Regular Member
(To:abjain)

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

abjain
12-Amethyst
(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'.

Announcements