Get Cell Value

Gets the value contained in a grid cell.

Command availability: IBM RPA SaaS and IBM RPA on premises

Script syntax

IBM RPA's proprietary scripting language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.

getGridValue --cultureformat(String) --ocrprovider(Nullable<OpticalCharacterRecognitionProvider>) [--googlevisionclientsecret(String)] --grid(ImageGrid) --row(Numeric) --column(Numeric) (String)=value


Use the Map Image Grid (mapGrid) or Get Image Grid (getGrid) commands to get the variable required in the grid parameter.

Input parameter

The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.

Designer mode label Script mode name Required Accepted variable types Description
OCR Provider ocrprovider Required OpticalCharacterRecognitionProvider Text recognition method to use.

See the ocrprovider parameter options
Clear trailing line breaks sanitize Optional when the OCR Provider parameter is Abbyy Boolean Trims the resulting text, removing trailing Unicode line break characters.
API Parameters googlevisionclientsecret Optional Text The absolute path to the JSON file containing the API parameters. Refer to the Google Cloud Vision™External Link documentation for details about the JSON format.
Grid grid Required Image Grid Mapped grid from which the value is obtained.
Row row Required number Row in which is the value to be obtained.
Column column Required number Column containing the value to be obtained.
Language cultureformat Required Text, Culture Language in which the value to be obtained is written.

ocrprovider parameter options

The following table displays the options available for the ocrprovider input parameter. The table shows the options available when working in Script mode and the equivalent label in the Designer mode.

Designer mode label Script mode name Description
Abbyy Abbyy Abbyy OCR Provider.
Google Google Google Tesseract OCR provider.
Google Cloud Vision GoogleVision Google Cloud Vision API.

Output parameter

Designer mode label Script mode name Accepted variable types Description
Value text Text Returns the value obtained from the grid cell.


The following example shows the getGridValue command returning a value from a cell in a table previously mapped using the Map Image Grid command.

defVar --name mappedImageGrid --type ImageGrid
defVar --name valueObtained --type String
// Open an Excel file and use the recorder to enter the commands waitWindow and mapGrid.
waitWindow --title "tableExcelCompanyCity.xlsx - Excel" --classname XLMAIN --processname EXCEL
mapGrid --columnmappings "27-141;141-281;281-388;388-450;450-515;515-580;580-644;644-706;706-771;" --selector "XPath" --xpath "/root/pane[1]/pane[1]/pane[1]/datagrid[1]" mappedImageGrid=value
getGridValue --cultureformat "en" --ocrprovider "GoogleVision" --grid ${mappedImageGrid} --row 1 --column 1 valueObtained=value
logMessage --message "Value obtained from the mapped table: ${valueObtained}" --type "Info"