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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Primary Keys are Type Casting

Ike@ACE
13-Aquamarine

Primary Keys are Type Casting

So, I've had a problem with data table keys for a while now. When I set a number field as the primary key for a Data Shape and it gets used by a data table, the "key" field gets type-casted in a weird way. Whereas the data shape's field, say "Item", is filled with the number "10", the key field is stored as a string and the "Item" field gets type-casted that way and the resulting string ends up being "10.0". This results in problems when you try to search by the number "10", it will say that there is no such key. I've been programming around this problem, but I'm starting to get worried about future upgrades to ThingWorx causing problems for me. Is this going to be a problem for me in the future? Has it been fixed since ThingWorx 8.5? Is there a way to stop ThingWorx from adding the extra ".0"? Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
kazunari
5-Regular Member
(To:Ike@ACE)

Hi, how about using INTEGER for base type for you primary key?

View solution in original post

1 REPLY 1
kazunari
5-Regular Member
(To:Ike@ACE)

Hi, how about using INTEGER for base type for you primary key?

Top Tags