Not able to copy row from a data table

I have one Excel file which looks like the one given below.
I have to take input from a user if the name entered by the user matches the name in the excel names it should copy the entire row for that and paste it into a new sheet2 of the file.

image

I have completed this much of the workflow

image

Now I have to define processes for then block
but I am very much confused on
how to copy the row.

Thankyou

1 Like

@rajyavardhansr

You need not use loop…

Instead use a filter datatable and use the output datatable to write back the row to excel…if excel already exists then use append range

Cheers

Hi @rajyavardhansr

You can use “Add data row” activity to add that row to a new datatable Dt2 (by passing the value “row”):
image

and then (outside your for each), using write range, paste that datatable Dt2 into a new sheet.
now the trick here is that you might find multiple matches to the name you are searching for, in that case your datatable will have more than one row.

@Emira


i am getting this error

Hi @rajyavardhansr,

Use array row like below

image

Thanks,

Was just getting ready to reply the same, that is the fix!