I managed to extract table from the webpage and returned as DataTable data type.
I found very difficult to manipulate this in “Invoke Code” as I have very complex in CSharp:
var res = dataTable.AsEnumerable()
.Select(r => new {
Id = r.Field(“Id”)
, Hits = r.Field(“Hits”)
, Date = r.Field(“Date”) // Use proper type here
})
.GroupBy(r => r.Date)
.Select(g => new {
Id = g.OrderByDescending(r => r.Hits).First().Id
, Date = g.Key
)
.ToList();
Couple question:
Is there any sample to work in returning datatable in Invoke Code by any chance?
In Assign, if we got complex Linq can we returned back DataTable? I found this is not possible.
IJust got a chance to check this, you may try below way, if not using Invoke Code.
Don’t have experience with Invoke Code, but you could do the similar way. You could use CopyToDataTable for Ienumerable DataRow to convert your linq to DataTable, but this query returns Ienumerable anonymoys type, so I had to convert to dictionary and later convert into a datatable. May be there is a better solution.