Write Cell + Find first/last row in Sharepoint Excel

Hello all,

I am trying to find the first emtpy row of an excel which is on a Sharepoint.

My only idea is to download the Excel and then use the find first/last row on the dowloaded Excel.

Does anyone have another idea?

Hi @VLC

There are various ways this can be achieved with one being that you mentioned.

However, there is one more way if you would prefer to not download the file from Sharepoint but still able to find the empty row or write into same.

For that, please follow below approach:

  1. Use microsoft O365 package

  2. Under microsoft O365 scope, use activity Read range(from o365 package itself)

  3. And then use below command on that datatable to find the index of the empty row. replace Dt with your datatable name in below command..
    Dt.Rows.IndexOf(Dt.AsEnumerable.Where(function(x) IsNothing(x(0)) OrElse String.IsNullOrEmpty(x(0).ToString.Trim))(0))

  4. After that, use write cell or write range activity to write in excel directly on index of empty row. Or you can choose to add the row in datatable and then overwrite whole datatable back to the sheet.

Hope this helps.

Regards
Sonali