Skip to main content
Solved

Data table value extraction

  • May 2, 2025
  • 3 replies
  • 292 views

Forum|alt.badge.img+7

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

 

StringVar = TableVar[0,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?

 

Best answer by Aaron.Gleason

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).

3 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+14
  • Automation Anywhere Team
  • Answer
  • May 2, 2025

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).


Forum|alt.badge.img+4
  • Navigator | Tier 3
  • May 10, 2025

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]


Forum|alt.badge.img
  • Cadet | Tier 2
  • August 28, 2025

You can also add record variable and add column number as index.