Skip to main content
1-Visitor
June 21, 2021
Solved

Convert Valuestream to an Infotable

  • June 21, 2021
  • 1 reply
  • 1468 views

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!

Best answer by abjain

@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;

1 reply

abjain15-MoonstoneAnswer
15-Moonstone
June 21, 2021

@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;

1-Visitor
June 21, 2021

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

15-Moonstone
June 22, 2021

@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'.