Returning JSON data

Hello all,
I’m trying to return a specific portion of JSON data. When I deserialize the file and set up the necessary variables, I can return the policy id and the policy number with a write line command with the following statement

However I need to return the ActionType and it’s throwing an exception stating object reference not set to instance of an object. Here is the json data

“PolicyId”: xxxx,
“PolicyNumber”: “xxxxx”,
“CurrentAction”: {
“ActionSequence”: 1,
“ActionType”: “CANCEL”,
“Channel”: “New York”,

Hey @Eric13

Yes because that is inside CurrentAction array.

so if you will use

it will return that whole info like actionsequence,Action Type and so and so.

To get Particular Value of ActionType use below code.

json_data.SelectToken(“CurrentAction”).SelectToken(“ActionType”).ToString //use it with writeline to see .


Thanks Akshay! Problem solved

Eric Jones

Reporting Analyst Sr, USA

Business Productivity

9950 Mayland Drive, Richmond, VA 23233

Tel: 804 281 6771 ext 36771