Skip to main content

Is there any way to retrieve a specific value from a data table like the following:

 

StringVar = TableVarr0,1]

 

ie, get value at row 1 column 1  in TableVar and insert it into StringVar.

 

Or do i have to loop through the table one row at a time to get the value i want?

 

Yes, you can get a single value. The rows and columns have a numeric index starting at 0 (zero).

When using something like a String: Assign, you can select the Table as your source. Then click “Add expression item”. It asks for the table. Consider that the “row”. Then click “Add expression item” again. It asks for the record. Consider that the “column”.

Your table reference will look like this:

You can use a variable for either index. Just remember the source of a String: Assign is a string, so numeric variables must be cast or have their values copied to a string variable (using the Number: To String action).


You can directly access a specific value in a data table without looping. You can use the String: Assign action and select the data table variable. Then, use the first to specify the row index and then the column index. Just remember that both row and column indexes start from 0.

For example, to get the value in row 1, column 1, you can do something like:
StringVar = TableVar[0,1]


Reply