Datatable

Updated at:

add_row

add_row(value=None)

Method description

Adds a new row to the data view.

Return value

Returns the index of the last row as an integer <int>.

Example call: rpa.project.datatable.add_row

# Note: If the number of data items in the row exceeds the number of title columns, the extra data is not added to the data view.
# For example, if there are two title columns and you add a new row with the data [1,2,3], only 1 and 2 are written to the data view.
# The following code shows an example call. After running, it adds a new row to the data view and returns the number of the last row.
datatable = rpa.project.datatable
new_row_num = datatable.add_row([1,2,3])

clear

clear()

Method description

Clears all data from the data view.

Example call: rpa.project.datatable.clear

# Notes: None
# The following is a code sample. Running this code will delete all data in the data view:
datatable = rpa.project.datatable
datatable.close()

insert_row

insert_row(row)

Method description

Inserting a row of data

Metric description

row<int> The row number.

Example call: rpa.project.datatable.insert_row

# Note: Before inserting a row, make sure that the corresponding row already exists in the data view.
# For example, before inserting data at row 2, make sure that the data view has at least two rows.
# The following code shows an example call. After running, it inserts a new row before the existing row 2.
# You can set the data for the newly inserted row using datatable[2]:
datatable = rpa.project.datatable
datatable.insert_row(2)
datatable[2] = ['Inserted using the Insert method', 'Will be inserted before the specified row number']

set_checked

set_checked(row, value=True)

Method description

Sets the checked state of a specified row.

Parameters

row <int>: The index of the row.

value <bool>: The checked state.

Example call: rpa.project.datatable.set_checked

# Note: Before using, make sure that the specified row exists.
# The following code shows an example call. After running, it checks row 1:
datatable = rpa.project.datatable
datatable.set_checked(1)

get_checked

get_checked(row)

Method description

Retrieves the checked state of a specified row.

Parameters

row <int>: The index of the row.

Return value

Returns the checked state of the row as a boolean <bool>.

Example call: rpa.project.datatable.get_checked

# Note: Before using, make sure that the specified row exists.
# The following code shows an example call. After running, it returns the checked state of row 1:
datatable = rpa.project.datatable
flag = datatable.get_checked(1)

scroll_index

scroll_index(index)

Method description

Setting the focused line

Metric description

index <int>: The index of the row to focus on.

Example call: rpa.project.datatable.scroll_index

# Note: Before using, make sure that the specified row exists.
# The following code shows an example call. After running, it sets the focus to the third row, which selects row 3.
datatable = rpa.project.datatable
datatable.scroll_index(3)