The data below is what I have:
{
"Result": "{\"Plot\":{\"Series\":[{\"color\":\"green\",\"title\":\"Temperature Gradient\",\"x_unit\":\"Temperature (°F)\",\"y_unit\":\"Depth (ft)\",\"dashStyle\":\"Solid\",\"lineType\":\"spline\",\"xAxisOnTop\":true,\"x_values\":\"80,90.78,101.56,112.35,123.13,133.91,144.69,155.47,166.26,177.04,199.96,210.63,220\",\"y_values\":\"0,-404.6,-809.2,-1213.8,-1618.4,-2023,-2427.6,-2832.2,-3236.8,-3641.4,-4046,-4502,-4825\"}]},\"OperatingTagResult\":null}",
"StatusCode": 200
}
I am interested in creating two new variables based on the provided data.
{\"Plot\":{\"Series\":[{\"color\":\"green\",\"title\":\"Temperature Gradient\",\"x_unit\":\"Temperature (°F)\",\"y_unit\":\"Depth (ft)\",\"dashStyle\":\"Solid\",\"lineType\":\"spline\",\"xAxisOnTop\":true,\"x_values\":\"80,90.78,101.56,112.35,123.13,133.91,144.69,155.47,166.26,177.04,199.96,210.63,220\",\"y_values\":\"0,-404.6,-809.2,-1213.8,-1618.4,-2023,-2427.6,-2832.2,-3236.8,-3641.4,-4046,-4502,-4825\"}]},\"OperatingTagResult\":null}
Extract only the value
200
associated with "StatusCode"
How can I achieve this?
I encounter an error when trying to parse the JSON data:
Uncaught SyntaxError: Unexpected token o in JSON at position 1