Skip to main content
1-Visitor
November 14, 2016
Question

How to update a row in an infoTable?

Hi Everyone,

So I would like to update a row in an InfoTable, but I couldn't find a snippet for it.

Basically, I would like to find my row first and then update an attribute of it and then push it back to InfoTable

like following:

var foundedRow = me.MyInfoTable.Find(myObject);

foundedRow.color = "blue";

me.MyInfoTable.UpdateRow(myObject,foundedRow)

7 replies

1-Visitor
November 14, 2016

MyInfoTable.myColumn=myNewValue;

Translate
1-Visitor
November 14, 2016

Hi Mustafa,

To update an Infotable Property, you should never do it directly on the property, instead you should copy the Infotable Change it and set it again as a whole on the property ( see step 1 and 4 😞

1. var modified = me.MyInfoTable; // -- This creates a copy of the infotable not a reference

2. var row = modified.Find(myObject);

3. row.color = "Blue";

4. me.MyInfoTable = modified;

Translate
1-Visitor
November 14, 2016

Can you explain why you should not modify the property directly?  There is no real difference in copying the infotable except for the fact that you now have another (potentially large) object occupying memory.

Translate