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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

Issues with infotable modification

AO_11298445
2-Guest

Issues with infotable modification

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

3 REPLIES 3

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:

  1. It could be a Composer bug, eg, if you try to read the value of that property via the GetPropertyValue service - does it return the same?
  2. Another thing to look, is what exactly does that that property contains if you Export the Thing as XML - just get in there and compare the Infotable property values before and after the modification
  3. Does your DataShape contain Default Values? I remember it was a very old bug here that manifested in some cases, but please check and let us know.

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.

Announcements


Top Tags