Where we will use index in excel

I know its a basic question, i searched for but im not clear with the concept

Im a newbie to Uipath automation. Where we use index in excel automation. Whats the purpose of using index. In Projects, usually we use to get the last row/ column count know.

@Subha_Sundara_moorthi

We will use index to read row values from Excel file. We can read particular row value by specifying either Column Name or Column Index. If column positions are fixed then we will use Index.

Eg. row(“ColumnName”) or row(0)

Note: Here, 0 is index and it refers to first column in Excel file.

1 Like

Hi @Subha_Sundara_moorthi

In addition to @lakshman we can create a variable index in for each row of the datatable properties

Regards

1 Like

Hi

Usually there two index used in Datatable

  1. Row index
  2. Column index

Both the index value starts from 0 for first row and first column

There are many cases where we use both of these index together or at times they are used individually

Case 1
When we want to get any specific cell value from datatable then we need both row and column index
And it has to be mentioned like this

Datatable.Rows(rowindex)(columnindex).ToString

Case 2
When we want a current row position Ina for each row activity

We can mention like this inside the loop

Datatable.Rows.IndexOf(CurrentRow)

Case 3
If we want to know column name of a specific column

Datatable.Columns(columnindex).ColumnName.ToString

Hope this would help you

Cheers @Subha_Sundara_moorthi

1 Like

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