Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
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 ).
Thanks,
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
Hi @VaibhavShinde,
Did my reply answer your question? If so, could you please designate my reply as the Accepted Solution?
Thanks,
Tony
Hi @TonyZhang ,
Thanks for reply , as you said Datatable can use but I can't create datatable as a Property.
Thanks
Hi @VaibhavShinde,
Yes, datatable is not a data type for Thing property, it's a type of storage or Thing and supposed to be used alone.
Any reason you have to make it a property of a Thing?
Hi @VaibhavShinde,
If you feel your question has been answered, please mark the appropriate response as the Accepted Solution for the benefit of others with the same question.
Regards,
Tony