Prepare an empty datatatable with build datatable and configure the following columns:
search (string) ,ridx (int32), cidx (int32) - dtReport
Prepare a variable
arrSearchKeys | String Array = new String(){“AMOUNT”, “TOTAL”}
Assign Activity
dtReport =
(From c in Enumerable.Range(0, YourDataTableVar.Columns.Count)
From s in arrSearchKeys
Let i = YourDataTableVar.AsEnumerable.ToList.FindIndex(Function (d) d(c).Tostring.ToUpper.Trim.Equals(s))
Where i > -1
Let ra = new Object(){s, i, c}
Select r = dtReport.Rows.Add(ra)).CopyToDataTable
Handling empty result:
[FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum