How to get the table data based on index?

Hi Team,
I have a table, let us assume [Month name and month number]: example([jan:1];[feb:2][mar:3];[apr:4]… so on till [dec:12])
I would like to copy a value which satisfies a criteria.
Ex: if item equals to “apr” then it should return value 4 and copy that value in a variable.

Is this possible to do? if so please provide me the solution.

Thanks in advance.

Sure, you can use index to access the value in a particular cell

You can read about using indexes here: https://kb.workfusion.com/display/RPAe/Recorder+Variables#RecorderVariables-UsingIndexeswithLists

Thank you so much Ashapkina. I will try this.

1 Like

If you have a table and not a list then you can use the following Custom Script to access:

@CustomScriptAction(
    input = ['data_table','row_pointer','col_pointer'],
    output = 'cell_value'
)
 
def customScript() {
     def cell_value = data_table.get(row_pointer,col_pointer) 
}

You just need to define data_table, row_pointer,col_pointer and cell_value as usual then they can be used in the script. Then set the row_pointer and col_pointer to point at whatever data in the matrix you require.

Very flexible and fast retrival from a table.

1 Like

It is also possible to use method get() in other actions in the Recorder to get the value of a particular cell in a table:

Constant value:

Enter keystrokes: