Scraping a data table and storing the row ID as an array of ints?

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.

Hello @dr1992

Please check the below.

Thanks

Hey Rahul, thanks for your reply - I still don’t quite understand (sorry, I’m new).

  1. I have the for each of the DT pDealDT and then the open deals/status ensure it scrapes the right fields.

  1. 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

I was trying to replicate the build you shared of (as an int) row(“oRowNumber”).ToInt() but it failed.

Hi @dr1992 follow these steps:

  1. Create a ListVarialbe of Int32 type(initialize it by New List(Of Int32))

  2. Then add your values to list by add to collection activity

  3. Convert the ListVariable to array (ListVariable.ToArray)

1 Like

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

This did it! I had no idea about initialising arrays - thanks for your help!

Great thanks @dr1992

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.