Updating Remark Column

Hi i have an excel to process like below

RPA will process based on the “PO NO” column and after completing it should add Remarks to the corresponding row

Note :slight_smile:

If there are 2 sub rows for the “PO NO” it should add 2 remarks in the Remarks column, and if there is 3 subrows it should add remarks for that also like below after the process,

You want to update the status as “Success” in the remarks column, correct? Or do you want to update the remark based on the row count — if the row count for a particular PO number is odd, then update it as “Failed”, and if it’s even, then update it as “Success”?

Hi @Gokul_Murali ,

Inside your For Each, at the end where the process is getting completed, add an If condition to check whether the Total column is blank or not. If it is blank, then don’t update the remarks. If the Total column contains data, then at the end it will update the remarks. So this is the flow

If condition:

CurrentRow("Total").ToString.Trim<>""

Write cell range:

"F"+(InputDT.Rows.IndexOf(CurrentRow)+2).ToString

Inputdata:

Output:

Regards,
Vinit Mhatre

I want to update the remarks column based on the flow.

But for the “PO NO” RPA is taking the Subrows under this means in yellow it is using 2 rows and after processing it should update 2 remarks column.

and for the 2nd “PO NO” it is using 3 rows in green and it should update the 3 remarks column.

Some time there will be only one row so it should update only one row

Hi @Gokul_Murali

You can use the following invoke code to get the desired results We are grouping base on the Endorsement column and writing in the remarks column.

For Each grp In dt_Input.AsEnumerable() _
.Where(Function(row) Not String.IsNullOrEmpty(row(“Endorsement”).ToString)) _
.GroupBy(Function(x) x(“Endorsement”).ToString)
For Each row In grp
row(“remarks”) = “success”
Next
Next

Here is the reference of the code:-


These are the inputs:
Case 1:-


Output:-

Case 2:-
image
Output:-
image

Hope this helps!!

1 Like

Hi i have used the below code since i some more conditions are required to update the remark column excel.i use the below code.

@Vinit_Mhatre Thanks i made some changes on the code now its working
@Sudeen_Raj_Shetty :slight_smile: Thanks