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

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Unable to store and retrieve location in a data table

DuanGauche
12-Amethyst

Unable to store and retrieve location in a data table

TLDR: Don't use a field name called "location" in your DataTable to save values of the datatype location. Just call it something else.

 

I have been trying to store some data in a DataTable and run into an issue where whenever I try to retrieve the location field, it would always be 0,0,0.

 

This was very confusing and I was clearly not the only person, here is an old post with a false solution:

https://community.ptc.com/t5/ThingWorx-Developers/Unable-to-store-location-in-a-data-table/td-p/513471

 

The problem lies in the fact that when your datashape has a field definition called "location" of datatype location, then you are duplicating the internal field definition of a DataTable.

 

Below is a screenshot of the default field definitions and you will see that there is a "location" field in there.

Screenshot 2023-07-26 at 11.27.24.png

Just change your DataShape to use a different field name (other than "location") and you should be fine.

1 REPLY 1
slangley
23-Emerald II
(To:DuanGauche)

Hi @DuanGauche.

 

Thank you for sharing your insights with the community!

 

Regards.

 

--Sharon

Announcements


Top Tags