DataTable keeps losing Initialization (Data Scraping tool)


For some reason I have a lot of problems with using the Data Scraping tool. This one in particular is a such a major pain.


The arbitrary exception is referring to ExtractDataTable which is a variable of type System.Data.DataTable.

The website did not change. Nothing changed. I didn’t move any variables. Does anyone else experience this issue?


This happens as soon as the method extract structured data is ran.

@r0manred Can u attach ur workflow

WorkEachJob.xaml (18.2 KB)

Before proceed the for loop, Please check the ExtractDataTable IsNot Nothing condition.


Hi @r0manred,

For some reason you are not able to scrap the data to datatable at that time table is null.

Before using use if condition to check the whether the table is null or not.

Is nothing(tablename)
True-> the table is null.

False -> having some data so go further.


Right this all makes sense.


(1) The table didn’t change. It was scraping from the same link and website.

(2) Shouldn’t I be able to check the amount of rows? somedatable.Rows.Count would return 0 if no table was scraped, right? The table is instantiated when the workflow starts the run.

Hi @r0manred,

Correct, but before getting the count make sure you checked isnothing condition


I deleted the original datatable scrape. Then I scrape the table again, it works, I have rows and columns. But, when I run the process, I receive the same error.


This happens when the process scrapes the data table. So at the action Extract Structured data, the process fails and gives me the error.

Another update,

IF i delete the workflow. And implement everything again. I don’t receive an error anymore. But, after running the process multiple times the error pops up again.

when you are creating a data Table variable better initiate it with new DataTable() in variables section.
If you are using build datatable then even though if you are not initialised it wont throw exception


new DataTable() or,

New System.Data.DataTable?

The datatable is set to New System.Data.DataTable

Edit: I believe it’s the same either way right?

Sry use first one
new DataTable

Fixed, had to create a new workflow.

Nevermind, yet again having this issue.


I am facing same issue. When I try with a variable by initializing it to new System.Data.DataTable , it works. But the DataTable from this extraction is needed for another process, so I had to use a DT type out argument, in which case I cant initialize it in invoked workflow (because it is out argument)

However, In Main flow (where this DataScrape extraction process is invoked), I assigned the out argument to a separate DT type variable which is initialized as new System.Data.DataTable, still I am getting this error. It seems this never works with arguments then? How can I solve this, I want the table from that webpage to b used in another process.

Thanks, Nitish

hi @candidNitz,

Here I have attached the sample to get an idea with populating the datatable with invoke work flow.

File : (11.2 KB)


Did you ever get this resolved??