Skip to main content
1-Visitor
April 19, 2022
Question

AddRow function does not update primary key field of infotable on ThingWorx

  • April 19, 2022
  • 1 reply
  • 1182 views

I am using the AddRow function to update an infotable.

It is copying values into all other fields except the primary key field.

Kindly advise me on how to correct this. See code snippet below and attached screenshot of the infotable.

 

// Get a direct reference to the infoTableProperty on the entity
var Pump_Curves = me.Pump_Curves;
// Create a new NamedVTQ entry object to add to the infotable
var newEntry = new Object();
newEntry.Delta_P = 1.87; // primary key
newEntry.RPM_700 = 14;
newEntry.RPM_800 = 15;
newEntry.RPM_900 = 1.2;
newEntry.RPM_1000 = 2.1;
newEntry.RPM_1140 = 5;
newEntry.RPM_ACT = me.F1; // Current flowrate
Pump_Curves.AddRow(newEntry);

1 reply

22-Sapphire I
April 19, 2022

This all looks correct, it shouldn't at all care about 'primary key' for an InfoTable.

The only thought I have is, try it with Delta_P set to 2.0 vs 1.87 and see what happens? or 2?

1-Visitor
April 19, 2022

Thanks PaiChung.

I have tried 2 and 2.0 to see what happens.

The service still behaves the same way. The issue is not yet resolved.