Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Is it possible to add rows to a things Infotable using REST? if it is can you please provide an example
The URL of the Thing/infotable is
The columns of the table are valueHex, time, signal, station
But if I call:
I get: Invalid Property Value Provided: Unable To Convert From java.lang.String to INFOTABLE
If I use
I get get the error: No Property Value Provided
I'm not sure how to construct a row of the table to add - Any sugestions?
Hi Graham,
You were close with your first API call, but since the property is an infotable, the value you pass in will be a JSON object. If you run the service in composer with the developer tools open, on the Network tab, you can see what is being passed into the property under Request Payload. Below is an example URL I used to do this. The JSON object must have the datashape defined.
https://SERVER/Thingworx/Things/TestTable/Properties/modemData?method=put&value={"dataShape":{"fieldDefinitions":{"valueHex":{"name":"valueHex","description":"","baseType":"STRING","ordinal":1,"aspects":{}},"time":{"name":"time","description":"","baseType":"STRING","ordinal":2,"aspects":{}},"station":{"name":"station","description":"","baseType":"STRING","ordinal":4,"aspects":{}},"signal":{"name":"signal","description":"","baseType":"STRING","ordinal":3,"aspects":{}}}},"rows":[{"valueHex":"30","time":"30","station":"30","signal":"30"}]}
SaeedMa
Thank you for your help but the code you have provided overwrites the infotable is is possible to append data?
Hi Graham,
Adam
Thanks, that suggests I'm on the wrong track, I was looking for a way to append data to a Thing in response to a push notification is there a way to do this?
Hi Graham,
You can do, however, create a service named "AddDataToModemData" taking exactly the parameters you said. Inside of that service you could add the row programatically to that property which is InfoTable.
Hope it helps!
BR,
Vladimir