UiPath Get Row Item Example |Video upload date:  · Duration: PT5M55S  · Language: EN

Learn how to use UiPath Get Row Item to read cell values from a DataTable or Excel with clear steps and tips.

If you ever wanted to extract a single cell from a DataTable without starting a small fire in your workflow designer this guide will help. We will use the UiPath Get Row Item activity like a competent automation artist and avoid the common traps that make RPA projects cry.

Prepare your DataTable

First step is honest work. Use Read Range from Excel or Build DataTable to load your data into a DataTable variable such as dt. This gives you a predictable input for all the automation fun ahead.

Why this matters for UiPath and RPA is simple. A clean DataTable beats random cell references when column order changes or someone renames a sheet to something dramatic.

Loop through rows with For Each Row

Drop a For Each Row activity and set the row variable to row. This is the stable loop context that lets Get Row Item target a specific row without guessing its mood.

Use Get Row Item inside the loop

Put Get Row Item inside the For Each Row body and set TargetRow to row. The activity reads one column value from that row and returns it as an Object type unless you configured otherwise.

Set either ColumnName or ColumnIndex to tell Get Row Item which cell you want. ColumnName is the safer pick for most Excel and DataTable based automation because it survives column reordering.

Example property values

' Inside the For Each Row loop
' Get Row Item properties
TargetRow = row
ColumnName = "CustomerName"
Output = cellValue  ' variable of type Object or String

' Avoid using ColumnIndex unless the file structure is guaranteed
  

Assign to variables and convert types

Save the output to a variable like cellValue. If you need a string call cellValue.ToString at the moment you need it. This avoids surprises when the underlying DataTable stores numbers or DBNull.

Example check when you need to compare or parse

If String.IsNullOrEmpty(cellValue.ToString) Then
  ' handle empty case
Else
  Dim textValue = cellValue.ToString.Trim()
  ' continue processing
End If
  

Handle types and error handling

Wrap risky parsing or conversions in a Try Catch activity to stop a single bad cell from crashing your entire automation. Common issues include DBNull values and unexpected types when users sneak in numbers or blank cells.

  • Prefer ColumnName over ColumnIndex to avoid brittle workflows
  • Use Trim on strings to remove invisible whitespace that breaks comparisons
  • Check for DBNull or use If String.IsNullOrEmpty before parsing
  • Cast explicitly when you expect numeric or date types to keep logic predictable

Quick recap and practical tips

To repeat without monotony follow these steps in your UiPath automation. Read Range or Build DataTable to get dt. For Each Row with row. Put Get Row Item inside the loop and choose ColumnName when possible. Assign the output to a variable and call ToString when you need a string. Wrap parsing in Try Catch and add simple null checks for robust error handling.

Follow these pointers and your RPA flows will be easier to maintain and less likely to explode during demo time. You are welcome.

I know how you can get Azure Certified, Google Cloud Certified and AWS Certified. It's a cool certification exam simulator site called certificationexams.pro. Check it out, and tell them Cameron sent ya!

This is a dedicated watch page for a single video.