Object Reference not set to an instance of an object - Assign Activity

Hi, trying to extract data from a json which is obtained from a HTTP Request from where the output is a String. The next step is a Deserialize JSON activity where the input is the string variable and the output is a JObject. The final step is an Assign activity where I call the JObject, input the name of the node I want and assign it to a variable.

image

The instruction inside the Assign activity is the following: vReportJObject(“Employee_ID”).ToString

Thanks! Any help is appreciated

@Daniela_Valdez_Luis Check the StatusCode of HTTP Request if its returning 200 or not,
if it’s returning 200 than deserialize it and print it to console and check “Employee_ID” key exists or not.

Check in debug mode If your are getting the correct response

Regards

1 Like

Thanks for the response! Its empty, should it be 200?
image

Just did it, its not writing anything as an output
Thanks!

Ok, not I got an output but I get the same error. Any further tips you might have for me?

@Daniela_Valdez_Luis,

Please log the JSON variable in the output panel to check whether it has an “Employee_ID” value in it. If you can share the JSON response in a text file or XAML file. We can look into it. Thanks.

can your share your workflow please?

Hi, I’m sorry
I can’t it has company information
Appreciate the help

can you please output in write line or message box your json before the assing activity?

Note that the key (“Employee_ID”) is case sensitive.
And best debug approach will be placing WriteLine (vReportJson) before the assign activity.

Cheers

@Danjela_Jahelezi you can use vReportJObject.selectToken(“Employee_ID”).ToString in the assign part