How to copy the value of the previous line if the current one is empty?

Hello all, hope to find you well,

I am currently with an issue where I extract a excel file from a server which comes with the following format.
example:

What I need to do, is to check the value of the current cell and if it’s empty, copy the value from the previous row to the current one, I have tried to do this using a for each row in excel file and an assign activity but it did not seems to work.

Does anyone have a better idea on how I should approach this situation? autofill is not an option since I will have cells with numeric values and the autofill will increment those values.

Thank you for your time and wish you all the best.

if you are using for each use current index -1 row data you will get that

so something like retrieve the current index, do a currentrow(index) if empty, assign currentrow(index-1) to a variable and write that variable into the current cell?

Yes You got it, but for last item in the datatable don’t forgot to apply condition

we can fill up like done in the below-presented flow:

here we can extend and handling also the other columns

Another technique is about concatenations of part ItemArray of the datarow

so imagine i have to do this for 4 columns, can I make a parallel and replicate those for row 0, 1, 2, 3 and will it work?

as mentioned

using take / skip / concat will help

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