dr1992
September 28, 2022, 11:11am
1
Hi there,
As I describe, I am scraping a data table and am struggling to get the row ID’s saved as an array of ints.
I have a ‘for each row’ and an ‘if’ to match the criteria I want to add, but I can’t seem to get the syntax right.
I have assigned the row ID’s to ‘pDealsDT.Rows.IndexOf(row)’, but how would I get all the correct rows to be added to an array? I would think I would need to use the row number variable to +1 each row, but how does that then get added to the array?
Thanks for your help.
dr1992
September 28, 2022, 11:32am
3
Hey Rahul, thanks for your reply - I still don’t quite understand (sorry, I’m new).
I have the for each of the DT pDealDT and then the open deals/status ensure it scrapes the right fields.
But then I get a bit confused here when adding to the array, I’m unsure how to write to add it to an array of ints:
Really appreciate your help!
can you share the expression provided in the errored assign activity?
Thanks
dr1992
September 28, 2022, 1:10pm
5
I was trying to replicate the build you shared of (as an int) row(“oRowNumber”).ToInt() but it failed.
Hi @dr1992 follow these steps:
Create a ListVarialbe of Int32 type(initialize it by New List(Of Int32) )
Then add your values to list by add to collection activity
Convert the ListVariable to array (ListVariable.ToArray)
1 Like
dr1992
September 28, 2022, 1:44pm
7
Thanks Tapan - when you say a ‘list variable’ are you referring to an ‘Array of Int’ or is this something different?
Edit: got it. Mscorlib. I will try now
Yes the list contains collection
If you select list of int32 then it can store collection of integers
Browse type and search
System.Collection.Generic.List
1 Like
dr1992
September 28, 2022, 2:09pm
9
This did it! I had no idea about initialising arrays - thanks for your help!
system
(system)
Closed
October 1, 2022, 2:11pm
11
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.