System error at initialization: Object reference not set to an instance of an object. at Source: Anonymously Hosted DynamicMethods Assembly

This is in reference to assignment 2 of RPA Developer Advanced course. Calculate security hash assignment.
The workflow runs and reads the data from “Work Items”. After it reaches the last page, it hangs there and throws the following error:
System error at initialization: Object reference not set to an instance of an object. at Source: Anonymously Hosted DynamicMethods Assembly.
Please advise.

1 Like

@g0furtherwithAI

Could you please show me screenshot of IF condition you mentioned in Get TransactionData workflow. So that we can check and help you.

Hi @lakshman The filtered data WI5_List isn’t printing…screenshot below.
Thanks for looking into it,

@g0furtherwithAI

Once print the value of dt inside that workflow ExtractDataFromBrowser.

If it is printing just check that select query once. Could you please show me screenshot of that select query expression once.

1 Like

I can see that select method you used wrong syntax
Dt_out.select(“[column] = ‘value’”)

Use like this

@lakshman @vinay_reddy
dt_out exports the data table correctly into a csv file. However, WI5_List doesn’t print anything.
The select statement is provided in the expression editor.
Please see screenshot below.

@g0furtherwithAI

The above select query expression will give result as Array of DataRow and you are trying to print it using Message Box activity and we can’t print this with Message Box activity.

Try like this.

     WI5list = dt_out.Select("Type = 'WI5' AND Status = 'Open'").CopyToDataTable 

The above expression will give you output as DataTable and then use Output DataTable activity and will convert DataTable into String and then use Message Box activity to print and pass that string to it.

Hi , that’s where the issue is , the select statement you used is wrong syntax
Please put column name in braces
Dt_out.select("[Type]=‘WI5’ AND [Status] = ‘Open’ ")
Dt_out variable should be Datarow array

If you want to print DT_out as datatable
Use assign and then

NewDT = Dt_out.select("[Type]=‘WI5’ AND [Status] = ‘Open’ ").copytodatatable
Then use output datatable activity

Input as NewDT
Output as String variable

Now use writeline / msgbox to write the output string

@vinay_reddy @lakshman

Thank you both. I tried with your recommendations. The message box wasn’t printed.
Screenshot below.
I have also attached the logs.


output.txt (1.3 KB)

Hi , Can you pls check the rows count of dt_out first
Dt_out.rows.count >0 or not
then WI5list.count >0 or not

If both returns value more than 0

Then in the Variables pane for the NewDT variable please initiate the datatable by giving default value as New System.data.datatable

Even after this it did’nt work for you , it could be because of cache , please close Uipath and restart

I am going to try but it looks like cloud.uipath.com is down.

@lakshman @vinay_reddy

Please see screenshot below. Nothing is happening past dt_out exporting rows to the csv file.
Please see screenshot of the logs and the variables in the workflow.
Does WI5List need to be assigned a default value?


@lakshman @vinay_reddy @arivu96
Guys , if you can help here, that would be much appreciated. Thanks.

@g0furtherwithAI

Why you are writing select query two times here ?

In the logs, it is showing different error like selector issue in Attach Browser activity. Could you please check the selector once and make it dynamic by replacing Dashboard word with wild card “*” in Title attribute.

       title = 'ACME System 1 - *'

I tried per your suggestion, @lakshman
This is the output of the logs and the selector.


image

Is there anyone who has encountered this and can provide some advice?

1 Like

This is for people who can face the same issue again. Here, “dt_out” DataTable is null.Please make sure to assign the dt_out correctly in the invoke arguments window.