I want to print the data AB-C-03/AB-C-04 in a new line in only the Product column. The data for AB-C-03 will be the same for AB-C-04 but in a new row.
Duplicate and answered:
Sequence:
Read Range (Excel Application Scope)
Output: dtInput
Build DataTable
Output: dtOutput (same structure as dtInput)
For Each Row (ForEachRow activity, iterating over dtInput)
If (Condition: row("Product").ToString().Contains("/"))
Assign (Inside If block):
productParts = row("Product").ToString().Split("/"c)
For Each (ForEach activity, iterating over productParts)
Add Data Row (Add DataRow activity to dtOutput)
Input: ArrayRow = {row.ItemArray.Except({"Product"}).ToArray().Append(productPart)}
Else (Else block):
Add Data Row (Add DataRow activity to dtOutput)
Input: ArrayRow = row.ItemArray.ToArray()
Write Range (Excel Application Scope)
Input: dtOutput
Please try this approach hope it works
Please check the below thread.
Better to check and refer before creating a new topic .
Regards
I Already checked your solution but i dont understand your activity like your process of assign activity, and thank you for your solution
Please can you write the code on UiPath Studio
First Assign dt.Clone will clone the headers from input datatable to resultant datatable.
This LINQ query takes each row from the dt DataTable, processes the “Things” column by splitting its value, creates a new array combining the first three elements of the row with each substring from the split operation, and then adds these arrays as new rows to dtResult. The final result is a new DataTable containing all the processed rows.
For LINQ expressions you can follow the videos of Automate With Rakesh and @ppr blogs for LINQ.
Regards
when we share a solution approach like
in our understanding it is an UiPath Modelling with essential Activities. Maybe you can help us what is meant
If it works for you please mark this as solution so the loop closes
If the solution works please mark my post as solution to close the loop since LINQ expressions are much faster in execution than in loops. As it is reporduced through UiPath Code in simple way and provided. Or if you have any queries let us know so that we can help you.
Regards




