Assign ExtractDataTable content directly into variables

Hi all,

I have extracted information from a website into ExtractDataTable. Rather than write the information into a spreadsheet, I want to write each cell of the ExtractDataTable directly into a series of variables. For example my ExtractDataTable contains:
Blue 4
Yellow 2
Green 5

I want to assign:
Var11 = Blue Var12 = 4
Var21 = Yellow Var22 = 2
Var31 = Green Var32 = 5

How would I do this, or am I just better off writing ExtractDataTable into a spreadsheet and reading the cells back into variables?


What do you want to do with those Variables?

I think creating so many Variables is not a good idea.(if they are a lot), rather utilize them from Datatable all through the code.

Either you can run a foreach loop iterating the Datatable and perform your next steps.


Save the datable to a spreadsheet and read specific ranges that you might need in your downstream (but again it has to be in a datatable)

Lets see what others has to say.

1 Like

After investing further, you’re correct vvaidya. I’m using too many variables. I’ve re-written my process to use fewer variables.

Thanks for your help.

datatables and arrays/lists are made exactly for the purpose of avoiding using lots of variables (which you can not anyway if you don’t know the number and the list is dynamic)

1 Like