Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
Hello, I'm new to thingworx. Working with version 9.1
I'm trying to create a service that aims to clean up the rows of an infotable-type property following a certain logic.
This service cycles through a set of things and for each one it clones the "alarms" infotable property with
var newAlarms = Resources["InfoTableFunctions"].Clone({
t: alarms,
});
newAlarms.RemoveAllRows();
it verifies if any of the rows present within the property is missing within a stream. Otherwise it applies
newAlarms.AddRow(alarm);
(where alarm is equal to the row index inside the loop)
if any rows have been removed in this process, the value of the cloned infotable is associated to the alarms property
thing.alarms = newAlarms;
The service seems to work, the alarm is removed, but it seems like the infotable gets corrupted after the modification. From composer I see that the property has rows inside it, but if I click to view the content a prompt appears asking me to select a dataShape. If I do this I see the lines but the fields are empty.
Any idea of what am i doing wrong? any help would be appreciated
Hi @AO_11298445
Could you please explain your use case in more details? May be some screenshots of the issue and your requirements will be helpful
/VR
Hi @AO_11298445
ThingWorx 9.1 is an old unsupported version of ThingWorx, so before I answer I would strongly suggest upgrading to the latest version of ThingWorx which is 9.6.0 at the time of writing (it also includes lots of security fixes).
Couple suggestions to check:
It would be helpful if you added the full code, and maybe your thing properties.
Cloning an Infotable and removing all rows is an expensive way to create an empty infotable.
Your alarms property is of type infotable, and it should have a datashape assigned.
you could then just use DataShapes["YourAlarmsDataShape"].CreateValues(); to create an empty infotable of the right shape.