Skip to main content
1-Visitor
August 29, 2018
Solved

Javascript queries

  • August 29, 2018
  • 1 reply
  • 1604 views

Hello Community,

I just started working on a project to optimize data updates so we started caching data from the server to thingworx itself but i do not manipulate as good javascript queries. I wanted to write a javascript service to query certain rows with partial information and i do not know what should i write in the filter to do so, to explain my problem more, let's suppose we have a row in the cached data table named Machine, the field machine has 3 base components A, b and C and i wanted the row having C= something. Can anyone help me with this, thank you so much.

Best answer by supandey

Hi @i_abidi i think this should help Query Parameter for Query Services.

 

Depending on what sort of entity you are working with to hold the cache in ThingWorx, you can use the Query in your query service. Below e.g. is from the DataTable having QueryDataTableEntries

 

// result: INFOTABLE dataShape: ""
var result = me.QueryDataTableEntries({
	maxItems: undefined /* NUMBER */,
	values: undefined /* INFOTABLE */,
	query: undefined /* QUERY */,
	source: undefined /* STRING */,
	tags: undefined /* TAGS */
});

1 reply

supandey5-Regular MemberAnswer
5-Regular Member
August 30, 2018

Hi @i_abidi i think this should help Query Parameter for Query Services.

 

Depending on what sort of entity you are working with to hold the cache in ThingWorx, you can use the Query in your query service. Below e.g. is from the DataTable having QueryDataTableEntries

 

// result: INFOTABLE dataShape: ""
var result = me.QueryDataTableEntries({
	maxItems: undefined /* NUMBER */,
	values: undefined /* INFOTABLE */,
	query: undefined /* QUERY */,
	source: undefined /* STRING */,
	tags: undefined /* TAGS */
});
i_abidi1-VisitorAuthor
1-Visitor
August 30, 2018

Thank you