How can I get the value of whole row by using Get Each Row

Like the topic I said, I have some questions while doing my PO process when I tried to fetch all the data from excel.

I want to know is there any way to fetch the whole row data by using Get Each Row but without column’s name because it’s PO and we don’t have a particular form.

I tried using the method I mentioned above and set the variable named columnIndex which is Increment to make sure I can get the whole data from each row from 0 to the end like, row(columnIndex++).
However, it came error: Object reference not set to an instance of an object.

Could anyone provide some ideas/solutions or sample?

Hi @opas1216

Use the below post
Get Row Item from Next Column

Thanks
Ashwin.S

Hi buddy
@opas1216
Welcome to UiPath community
That was a good question to start frm
Fine
So in order to get the values of all the column in a row using get row item Activity with incrementing column index is fine but the columnindex must be incremented in the property and not in datarow input…like
– hope you have a variable of type datatable and lets name it outdt
–create a variable of type int32 named counter with default value 0
–now use a while loop like this with condition
Counter < outdt.columns.count
–inside this while loop use a get row item Activity and mention like this
in datarow input - outdt.Rows
In columnindex input - Counter
In output as - outvalue
Where outvalue is a variable of type string
–next to this get row item use a assign ACTIVITY to increment the value of counter
Like this
Counter = Counter +1

That’s All buddy you are done
Kindly try this and let know for queries or clarification
Cheers @opas1216

2 Likes

hello @opas1216
if you want to get the whole row value you can also use Read Row activity and it’ll output whole row value in simple and minimal steps
Please check this workflow for better understanding
ColumnTest.xlsx (9.8 KB)
Getting whole row.xaml (9.6 KB)

hi outdt.Rows is throwing an error saying that “DatarowCollection cannot be converted to Datarow”. any suggestion on how to fix this issue?

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.