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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Set min/max for slider widget from data table

bmaxted
1-Newbie

Set min/max for slider widget from data table

Hi, I'm new to Thingworx and am hitting an issue converting data types.

On my mashup I've got a Slider widget, and would like to set the Maximum and Minimum values based on the minimum and maximum values of data within a column of a Data Table.

In my mashup I can use the Aggregate service to get a 1x1 InfoTable containing either the minimum or maximum value, but am not sure how to get the integer value out of the InfoTable to bind it to the Maximum and Minimum fields of the Slider Widget. Do I need to develop my own Service to do that?

2 REPLIES 2
supandey
19-Tanzanite
(To:bmaxted)

Hi Benton, if you have multiple rows in that Infotable and if you are looking to fetch e.g. the min value of all you'd want to write your custom query which will basically loop through and fetch the required value; you can use this OOTB snippet for looping over the Infotable

var tableLength = yourInfotableHere.rows.length;

for (var x = 0; x < tableLength; x++) {

var row = yourInfotableHere.rows;

//Your code here

}

Edit:

Additional link : What is an InfoTable?

I was hoping for an easy way without writing my own service. The Aggregate service gives me the number, in a 1x1 table, which I'd like to extract and bind.

It looks like writing my own set of services to calculate min/max/avg on columns of an infotable would be easiest.

Top Tags