Object reference not set to instance of object with JSON Array

i am trying to display roleName in message box below as i mentioned

item(“serviceOrder”)(“order”)(“contacts {if roleName = Local Contact - Primary}”)(“firstName + lastName”).ToString

i am getting object reference not set to instance of object error

can anyone help me out.

1 Like

Hi @bsamala

Can you share your xaml file and jsonfile to adress the issue

cheers
Happy learning

1 Like

[
{
“serviceOrder”:
{

“order”:
{
“customerAccount”:
{
},
“contacts”:
[
{
“roleName”:
[
“Order Entry Specialist”,
“Order Creator”
],
“attributes”:null
},
{
“type”:“External”,
“roleName”:
[
“Local Contact - Primary”
],
“lastName”:“abc”,
“firstName”:“def”,
“attributes”:
{
}
},
{
“type”:“External”,
“roleName”:
[
],
“attributes”:
{
}
},
{
“type”:“External”,
“roleName”:
[
],
“attributes”:
{
}
},
{
“type”:“External”,
“roleName”:
[
“Local Contact - Primary”
],
“lastName”:“abc”,
“firstName”:“def”,
“attributes”:
{
}
}
,
{
“type”:“External”,
“roleName”:
[
],
“attributes”:
{
}
},
{
“type”:“External”,
“roleName”:
[
],
“attributes”:
{
}
}
],
“attributes”:
{
}
},
“criticalDates”:
[
{
},
{
},
{
},
{
},
{
},
{
},
{
}
],
“billingAccount”:
{
},
“groupIDs”:
[
],
“custPons”:
[
],
“serviceComponents”:
[
{
“product”:
{
},
“terminatingSites”:
[
{
“attributes”:null
}
],
“asriAttributes”:
[
{
},
{
}
],
“attributes”:
{
},
}
],
“product”:
{
“parentProduct”:
{
},
“attributes”:null
},
“locations”:
[
{
}
],
“relatedOrders”:
[
{
},
{
},
{
},
{
},
{
},
{
}
],
“attributes”:
{
},
},
“milestone”:
{
“milestones”:
{
“1”:
{
},
“2”:
{
},
“3”:
{
},
“4”:
{
},
“5”:
{
},
“6”:
{
},
“7”:
{
},
“8”:
{
},
“9”:
{
},
“10”:
{
}
},
{
“1”:
{
},
“2”:
{
},
“3”:
{
},
“4”:
{
}
}
},
}
]

hi @pattyricarte that’s the json response.

Check out the following topic on JSON parsing

Or the following StackOverflow on JSONPath