For a LINQ approach, ensure the prepared dtResult which has column X on the end
(From d in dtData.AsEnumerable
Let cj = d("Column A").toString & d("Column B").toString
Let ra = d.Itemarray.Append(cj).toArray
Select r = dtresult.Rows.Add(ra)).CopyToDataTable
(From d in dtData.AsEnumerable
Let colSet = new String(){"Commodity","Trade_Type","TRANSACTION_TYPE","Calculation_Type","MarketCodeIdx2","CONTROPARTE_CONSUNTIVO","Ptf_Bilancio_Da","Gestore"}
Let jc = String.Join(" ",colSet.Select(Function (x) d(x)))
Let ra = d.Itemarray.Append(ca).toArray
Select r = dtresult.Rows.Add(ra)).CopyToDataTable
i modified your code with my DT as follow:
(From d In DTOrigine.AsEnumerable
Let colSet = New String(){“Commodity”,“Trade_Type”,“TRANSACTION_TYPE”,“Calculation_Type”,“MarketCodeIdx2”,“CONTROPARTE_CONSUNTIVO”,“Ptf_Bilancio_Da”,“Gestore”}
Let jc = String.Join(" ",colSet.Select(Function (x) d(x)))
Let ra = d.Itemarray.Append(jc).toArray
Select r = dtresult.Rows.Add(ra)).CopyToDataTable
Uipath reports:
Assign: Input array is longer than the number of columns in this table.
Have you checked if you have cell with null value(s) where column X is empty?
E.g. the first three rows in the table below have null values:
With the expression "[Dosage]+[Drug]+[PatientID]" in Sum column you get:
If you modify the expression to check for null and replace it with an empty string, you will get:
Expression: "ISNULL([Dosage],'')+ISNULL([Drug],'')+ISNULL([PatientID],'')"
I was answering to you, ptrobot (i’m trying with your solution now).
I used your suggestion but if I use all the columns Uipath gives me that error message.
If I use just a subset (for example the first 2 columns) it works
Instead of including all columns at once, you have tried to extend the expression with one or two columns at a time to pin point the column UiPath is having issue with?
I suspect that the culprit column name is spelled wrong and doesn’t exist in the table.