Set min/max for slider widget from data table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Labels:
-
Mashup-Widget
- Tags:
- infotables
- services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.