DataTable keeps losing Initialization (Data Scraping tool)

Hello!

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.

JobSelector

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?

!!!EDIT!!!

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

@r0manred Can u attach ur workflow

WorkEachJob.xaml (18.2 KB)

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

Regards
Balamurugan.S

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.

Regards,
Arivu

Right this all makes sense.

But,

(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

Regards,
Arivu

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.

EDIT:

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.

@r0manred
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

Regards,
Mahesh

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?

@r0manred
Sry use first one
new DataTable
Regards,
Mahesh

Fixed, had to create a new workflow.

Nevermind, yet again having this issue.

aHello,

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 : InvokeWorkFlow.zip (11.2 KB)

Regrads
Balamurugan

Did you ever get this resolved??