Object reference not set to an instance of an object in json filtering

I’m filtering a datatable to read from a json and write into excel sheet
only one field is not getting extracted and giving me Object reference not set to an instance of an object error message.
Only when BoxNumber field is added

I have attached my code and the json file for reference.
Thanks in advanceJsonToDatatable.xaml (12.4 KB) response.json (183.8 KB)

1 Like

@supermanPunch could you please help me in this? u helped me to build this solution earlier

Thanks :blush:

@Thulini_Dissanayake What is the problem that you have faced ?, Can you explain the new requirement? When I executed the workflow it gave me 3 Output Files without any errors :sweat_smile:

1 Like

@supermanPunch I want to add BoxNumber also to the table.But when i add it it gives me object reference not set to an instance of an object error
I added a new column to the datable as well as changed the addrow code.

@Thulini_Dissanayake The BoxNumber Column is present with values in the Output Excel Files that i got :sweat_smile:

1 Like

@supermanPunch now the boxnumber column is getting without any errors still i dont have any values for boxNumber

@Thulini_Dissanayake But I get the Box number values as well :sweat_smile:
It might be because you have provided me a different file.

1 Like

@supermanPunch you are correct this happens with the file i’m using what could be a possible reason for that?
I’m getting the below error

Capture

@supermanPunch I found the issue, issue is some items doesn’t have a variable called boXNumber any way that i can resolve that issue? Like using a if condition to check boxNumber is present in json file?

If you can help me in this .

@Thulini_Dissanayake Will there be any other fields empty, I can put the if logic for that all together if there are :sweat_smile:

@supermanPunch Nope all other fields does have a value atleast there is " " for indication of empty. But here even the Field name (BoxNumber) is not there in some of the items.

@Thulini_Dissanayake Can i get the Data which doesn’t have a Box Number?

@supermanPunch
This is a sample without a boxNumber
response (2).json (183.8 KB)

@Thulini_Dissanayake Check this Workflow, it didn’t add Box number for one row :

JsonToDatatable.xaml (13.4 KB)

@supermanPunch Its working!!

Thank you so much You are a legend :slight_smile:

1 Like