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

Get the row index from an infotable?

Regular Member

Get the row index from an infotable?

How can i retrieve the row index value like [0]? Using this code is have the following:

var infoTable = me.mapLocations;

var values = new Object();

values.Name = NetworkAsset;

var row = infoTable.Find(values);

to get the row object, but i'm having a problem getting the index number from this.

Thanks.

Andy

Tags (1)
2 REPLIES 2
Highlighted

Re: Get the row index from an infotable?

Hi,

To retrieve row index for the particular value use for loop:

var size = Infotable.getRowCount()

for (var i=0;i<size;i++)

{

     if (Infotable.rows.FIELD == "VALUE")

          break;

}

result = i // Index for the particular value

Highlighted

Re: Get the row index from an infotable?

Your code it's not 100% correct, i variable it's a local variable on the for loop, you won't have it out of the loop. If you wan't you code to work, you should set a variable out of the loop and set it before the break.

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!