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

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Disable Grid Widget Boolean Autofill

Ascherer17
14-Alexandrite

Disable Grid Widget Boolean Autofill

Using Thingworx version 9.4.1 on a high availability (HA) cluster.

We're building a Thingworx app to display historical Thing data using the Grid widget in a mashup.  The data is streamed from a Kepserver and saved in a Value Stream by logging the Thing properties.  The mashup uses the "QueryPropertyHistory" service to pull a specified time period of data for all logged properties (currently only allowing data to be queried earliest to latest-"oldestFirst"=true).  We also provide the option to export the queried data to csv file using the Data Export function.

 

We just found a problem with the Grid widget that I'm looking for help to overcome; the Grid seems to be automatically filling in all empty BOOLEAN-type data cells with "false".  This is a problem because the actual value of the property could have been "true" at the time queried. 

 

I replicated this issue by manually setting two booleans, let's call them "Bool1" and "Bool2" (shaded RED in screenshots), to "true".  I also let a simulated NUMBER property generate some data so I will have multiple rows of data to query.  I set my query timespan to a time after the time I changed Bool1/Bool2 both to "true".  Pulling this data in the mashup provided the result below.  Exported csv file also shown below to verify that no data was logged during the time period (red-shaded columns are the Bool1/Bool2 properties). 

**Note there is a time difference because server time is UTC; we'd also like to export the timestamps to user-time, but that's a separate issue!

As you see, the Grid is showing users that Bool1/Bool2 have a value of "false" for the entire time period while I know they are actually "true".

 

So, in short, is there a way to disable the auto-fill that this Grid widget is doing for Booleans? 

Preferably we would like the cells to simply be empty until we can create a service to accurately fill all empty cells of the queried data.

Ascherer17_2-1704398460219.png

Ascherer17_3-1704398664106.png

 

 

5 REPLIES 5

Did you try by making the column data type as String, instead of Boolean ?

Ascherer17
14-Alexandrite
(To:Bikash_Panda)

I believe I failed to mention an important piece: the application allows the user to select a Thing from a list.  Since the Thing will be dynamic, the "QueryPropertyHistory" service's only known parameter at design time is "timestamp".  The rest of the properties for the column headers will only be defined at run time.

Using 9.5.0. If following option availble in 9.4, kindly try.

Sathishkumar_C_0-1705060544428.png

 

Yes, I did try that option in the service.  The Grid widget behavior is the same for BOOLEAN type columns.  

Ascherer17_0-1705067957594.png

 

TonyZhang
13-Aquamarine
(To:Ascherer17)

Hi @Ascherer17 

I don't think this is caused by Grid widget autofill for display, the raw data is false.

boolean type cannot be undefined or empty, it has to be either be true or false.

So if no data passed to the boolean property, it will default to false. 

See How do you check if a Boolean is undefined? 

If you wish to has a state of "undefined" and display nothing on the Grid, change the property to string type to store the data in the first place.

 

Top Tags