Skip to main content
16-Pearl
June 26, 2021
Question

Create infotable from Datashape doesn't work with Primary key. (Thingworx 9.1.0)

  • June 26, 2021
  • 1 reply
  • 2015 views

Hi,

when i create infotable from datashape with Primary key it is accepting duplicate key. below are some snaps..please suggest the correct solution. i want to store entries with primary key. when i enter duplicate key it should update automatically as datashape contains  a Field (Primary key ).

 

VaibhavShinde_0-1624684485628.png

Thanks,

1 reply

Support
June 28, 2021

Hi,

 

This works to specification that infotables does not honor primary key.

You can use datatables (under data storage section) to store records with unique primary key (specified by datashape).

If you use predefined "AddDataTableEntry" service adding a record with duplicate key, a warning with "Entry With This Key Already Exists" will appear as the output; if you use "AddOrUpdateDataTableEntry" service to add a record to the datatable, it the key already exists, the data will be updated/overwritten with the new entry.

 

Best,

Tony

Support
August 2, 2021

Hi @VaibhavShinde,

 

Did my reply answer your question? If so, could you please designate my reply as the Accepted Solution?

 

Thanks,

Tony

16-Pearl
August 4, 2021

Hi @TonyZhang ,

Thanks for reply ,  as you said Datatable can use but I can't create datatable as a Property.

 

Thanks