Object reference not set to Instance of an Object: write line

Hi there everyone.

I kindly need assistance, I am busy running a process in Uipath and I am having issues with one section that gives me the result “Write Line: Object reference not set to an instance of an object”. Please kindly view, below, the screenshot that shows the text filled in, in the write line text box.

That means that either:

  • You have not initialised FlatFileDT properly in the workflow
  • You have not passed an argument into your workflow when it was invoked

What do your invoke arguments look like?

@wendy Your variable value is having null value so you are getting this error.

@indra think that would still return a value of 0 if the DT has no values in it. It shouldn’t impact the ability to write line for the number of rows.

Hi AndyD

This is how the invoke argument looks:

invoke%20argument

ok, that narrows it down. Where did you declare the original flatfileDT? That may be the problem. try doing a write line with the same coding straight after it was created and see if you get the same error

Okay, I will try that and let you know if I get the same error.

Please kindly check the following screenshot (this is where the original declaration of the flatfileDT is situated):

The FlatFile you have initialised here is an array of strings, where are you converting that to a datatable (FlatFileDT)? If you aren’t converting it correctly then that is where the issue lies

@wendy did you get this one resolved?

Hi AndyD

I was booted out of where I was working (the remote desktop at work) so a trouble shooting is happening.

Thank you for your assistance. I will solve the issue .

1 Like

Hi,

I’m working on Email Activities in ui path, my problem statement is : I just want get attachments from my inbox and save the attachments ,in those attachments i want to copy the sheet and save in to another sheet and add the new column in new sheet by doing that i’m getting this error image can any one pls help me on this