Get Cell Contents
Verb: getTableCell
Gets the contents of a cell, located from the intersection of a column and a row.
Syntax
getTableCell --dataTable(DataTable) --column(Numeric) --row(Numeric) (Scalar)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--dataTable | Data Table | Required | Data Table | Data table from which cell contents are obtained. |
--column | Column | Required | Number | Numeric position of the column in which the cell is located.
The number that will indicate the column position must be greater than or equal to 1. |
--row | Row | Required | Number | Numeric position of the line where the cell is located.
The number that will indicate the line position must be greater than or equal to 1. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
value | Content | Primitives | Returns the contents of the obtained cell. |
Example
The command gets the contents of a specific cell by locating it through the column number, followed by the intersection line number.
defVar --name excelFile --type Excel
defVar --name excelTable --type DataTable
defVar --name cellContent --type String
// Download the following file to execute the command.
excelOpen --file "tableExcelCompanyCity.xlsx" excelFile=value
excelGetTable --file ${excelFile} --getfirstsheet --entiretable --hasheaders excelTable=value
getTableCell --dataTable ${excelTable} --column 2 --row 3 cellContent=value
logMessage --message "Cell Content: ${cellContent}" --type "Info"
// This example returns the following output:
// Cell contents: Armonk.
For the correct operation of the script above, it is necessary to download the file and enter its path in the File parameter of the Open Excel File command.