How to get value starting from 1 index while using for each row in data table?

Hello guys,
I’m stuck in between my project, here the scenario is: Need to read one row that consists of many columns but I want the activity to start only from index 1 using **for each row ** looping

FOR EXAMPLE:
“Row” = Laptop
“Columns” = 45600
“Columns” = 48900
“Columns” = 35600
“Columns” = 25560
“Columns” = 60540
“Columns” = 15600

Aim is to skip the row “Laptop” and start from 45600. how can I achieve that ?

Screenshot:

1 Like

Hi @Prabin_Chand,

Do I understand correctly, you want no 1st column in the loop.

If yes you can remove index 0 with filter and assign a new datatable before loop starts. You use this new datatable in the loop as well.

Regards,
MY

set index variable in “for each loop” activity

then in the loop, add if condition (if index =0, continue)

1 Like

Hi

Hope the below steps would help you resolve this issue

There are two ways to handle this

  1. If the first row is always like that then we can remove that row itself and use FOR EACH ROW activity normally

To remove that row from datatable use REMOVE DATAROW activity
Where mention the row index as 0 and mention the datatable with your datatable name

Or

  1. If you don’t want to remove that row, but process the datatable

Then

  • get the datatable named as dt
  • now use a FOR EACH ROW activity and pass dt as input
  • inside the loop use a IF activity with condition like this

dt.Rows.IndexOf(CurrentRow).Equals(0)

If true it means it is first row index which will take the workflow to THEN block
Leave that THEN block empty so that nothing happens for first row

If false it goes to ELSE block where keep the set of activities you want to perform which will neglect first row and proceed further

Cheers @Prabin_Chand

Hello @Prabin_Chand ,

I hope you are trying to do some action on the Excel. Its not mandatory to use Read Range activity. if you want to loop through the rows by eliminating the header you can do as below. Make sure to select the “Has headers” in the For Each Excel Row" activity. If you do as below, the values will start from “Columns” = 45600