Write Range Workbook: Object Reference Not set to an instance of an Object_Error while getting Queue Items from Orchestrator

Hello,

I am facing an error while Adding the Queue Items to the Data Row using Add Data Row.

These are the steps I am following:

  1. Build Data Table : Output - DT_Reporter

  2. Get QueueItems : Output - QueueItems

  3. For each Item, in Queue Item,

I am assigning the Queue values to a String Variable , I can able to see the values when I print through Write Line Activity.

Add Data Row - output DT_Reporter

  1. Filter Data Table

  2. Write Range Workbook

when i run the process, i am getting Write Range: Object reference not set to an instance of an object: Null Value Exception

I figured out that the Add Data row is not updating the values from Get Queue Items, hence the Data Table is empty, but I do not know how to resolve it, because when i print those individual Queue items in write line, there is data on them.

Can someone please help on the issue.
Thanks in advance

Hi
Why are you using Output DataTable ?

Try print DataTable Rows Count before filter to see if some row has been added

is it an issue with in_config?

before write_range activity
can you print out the value of in_config("EDC_OutputExcel_FilePath").toString ?
it might be that you dont have a value for in_config
image
@Alekhya_Gandhi

Hello @rikulsilva , i have tried printing the Data row count. one after building the Data Table which is ‘0’ and another one after Add Data Row , that also updated as ‘0’. It should have a row in it. But it doesnt.

Hi @jack.chan,
I guess not. There is an Asset with that file path which is updating fine.
The Data Table is having Null values which is actually not. As I could see the values in all those variables in Write Line which passed to the Array Row in Add Data Row

Here is the Output screenshot
Highlight1: Data Row count after Building a Data Table = 0
Highlight2: output from Get QueueItems (writeline: QueueItems.ToString)
Highlight3: Output from QueueItems Variables Writeline (which is as expected )
Highlight4: Data Row Count after Add Data Row = 0


i

Hi @Alekhya_Gandhi

Can you try printing the data row count in below places

  1. After For each queue Items
  2. After Filter Data Table activity

I think, the filter condition is removing all the rows from the data table, if any row count is displayed after For each. then filter data table condition need to be tweaked

Thanks
John

Put a break point at build DataTable and run you workflow in debug mode. After run, use step into in debug tab so you can go and check output activities individually in imediate pane or locals pane.

This way you also can check if try fails and catch branch do something or filter activity removes rows

@Alekhya_Gandhi

can you try printing your data row count before the “filter data table” activity to check the count.

From the workflow, it seems to be you are printing the count after the “filter data table” activity.

also, can you try to use write line activity before “Write Range workbook” activity to check the path of the file.

Cheers

@Alekhya_Gandhi

  1. Write range is not failing because of datatable i beleive…as because of build datatable there is atleast the headers present so the datatable would still be written on to excel…because if there is some issue then it would have failed in output datatable activity itself
  2. Now coming to add data row…can you please check in your variables if there are multiple datatables declared with same name…

Cheers

Hi @Venkat4 , I have tried printing the path of Output file and it is throwing Null Exception. Hence I manually added the file path, and the exception is gone now.

Still, There is no data being written into the excel since the Data row count is still 0 even after adding the Add Data Row.

As @Anil_G suggested, atleast the Column names should be written to the excel. but the sheet is empty and execution is ending without any errors

@Alekhya_Gandhi

please check in variables if multiple variables created with DT_Reporter name. if multiple are created delete one variable and try to rerun the workflow.

Also, I see you have output data table activity used. please disable the activity.

cheers

Hi @Venkat4 ,

Thank you for your advise.

Rather than passing the File Path variable, I have directly given the file path, and it worked.

Data is writing into the excel now.

Thanks again!
Alekhya

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.