Adding final remarks column on the output file

In my output file I want to add consolidated Final Remarks column at the last
In Final Remarks column i need to update the status of Process as
Done for if all Process were done
If any Exceptions there on process column need to update it on the Final remarks column as mentioned on the screenshot.
If any Exception occured on the Process it will not be move to the next process.
Example p1 is done ,p2 done , p3 exception , p4 & p5 column will be empty only.
Attached the excel file.
Final Remarks.xlsx (9.1 KB)

need clarification so if their is any exception in middle and later if the process is done then the status should done?

Example p1 is done ,p2 done , p3 exception , p4 done in this case will final remarks be done?
How large the data will be ,
do you use modern with use excel file

Regards

If any Exception occured on the Process it will not be move to the next process.
Example p1 is done ,p2 done , p3 exception , p4 & p5 column will be empty only.
The maximum count will be 500 to 700
Not using modern activity

first read range
use invoke code activity give the arguments the table with in/out direction
use the code InDT.AsEnumerable().ToList().ForEach(Sub(row) row("Final Remarks") = If({row("Process1").ToString.Trim,row("Process2").ToString.Trim,row("Process3").ToString.Trim,row("Process4").ToString.Trim,row("Process5").ToString.Trim}.Where(Function(x) Not String.IsNullOrWhiteSpace(x)).ToArray.Any,{row("Process1").ToString.Trim,row("Process2").ToString.Trim,row("Process3").ToString.Trim,row("Process4").ToString.Trim,row("Process5").ToString.Trim}.Where(Function(x) Not String.IsNullOrWhiteSpace(x)).ToArray.Last,row("Final Result")))
here InDT is the Datatable
next write range to the file
Regards

1 Like

@Praveen_Vs

Please try this

Read the data into datatable dt

invoke code and send dt as in/out

dt.AsEnumerable.ToList.ForEach(sub(row) row("Finalremarks") = row.itemarray.Reverse.FirstOrDefault(function(x) not string.IsNullOrEmpty(x.ToString)))

Or use for loop on the datatable and use assign as beloe

CurrentRow("Finalremarks") = CurrentRow.itemarray.Reverse.FirstOrDefault(function(x) not string.IsNullOrEmpty(x.ToString))

Hope this helps

Cheers

1 Like

@LAKSHMI_NARAYANA_PEMMASAN @Anil_G Thanks for the solution guys, All the methods working fine.

1 Like