Bring next row to current row

As image above, I want to bring Safuan into the same line as “Aqiff Shamsul” as it is in one word. So, it will be “Aqiff Shamsul Safuan”. How can I do this in UiPath ?

Hi @aqiff

Suppose I have a table like this


Iterate over the rows of the table and where there is empty string in the Dept Column replace the value before it with the current value

Properties of For Loop


Assign Activity

inputDT.Rows(indx-1).Item("Name") = inputDT.Rows(indx-1).Item("Name").ToString+" "+CurrentRow.Item("Name").ToString

Properties of Add To Collection


After that iterate over the collection to delete the rows


Properties of Remove Data Row


Variable Panel

For your reference

Bring Next Row to Current Row.xaml (10.5 KB)

Note: Instead of Build Data Table Activity you have to use Read Range Activity to read the excel file and store it in a Data Table Variable like inputDT in above case.
And please change the column names accordingly wherever used.

1 Like

@ppr @Yoichi @NIVED_NAMBIAR @prasath17

How to solve this problem through LINQ?

Very interesting solution though, I will try this later !

Yes sure, I heard about LINQ, but I am interested to learn how to do this using LINQ

Linq could add an overhead to it and risks to make it over complex along with putting it into a blackbox. The Quick Update approach and remove later rows by index is a more clear and traceable approach. (From this statement is exlueded things done by invoke code and mirroring for each acitvity)

Just for evaluation purpose have a look on this LINQ

with the risk of bugs (odd / even rows …)

Samples I/O:

Feel free to stress test it
OnNextRow_1Col_MergeToPrev_DelNextRow.xaml (8.3 KB)

But lets also focussing back to this origin topic: @aqiff Any updates? Is it solved

1 Like