Parsing json file

Hello, I am trying to parse json file, to get the value of P of the object lastQuote in json file:

{
 "status": "OK",
 "ticker": {
  "day": {
   "c": 120.4229,
   "h": 120.53,
   "l": 118.81,
   "o": 119.62,
   "v": 28727868,
   "vw": 119.725
  },
  "lastQuote": {
   "P": 120.47,
   "S": 4,
   "p": 120.46,
   "s": 8,
   "t": 1605195918507251700
  },
  "lastTrade": {
   "c": [
    14,
    41
   ],
   "i": "4046",
   "p": 120.47,
   "s": 236,
   "t": 1605195918306274000,
   "x": 10
  },
  "min": {
   "av": 28724441,
   "c": 120.4201,
   "h": 120.468,
   "l": 120.37,
   "o": 120.435,
   "v": 270796,
   "vw": 120.4129
  },
  "prevDay": {
   "c": 119.49,
   "h": 119.63,
   "l": 116.44,
   "o": 117.19,
   "v": 110597265,
   "vw": 118.4998
  },
  "ticker": "AAPL",
  "todaysChange": 0.98,
  "todaysChangePerc": 0.82,
  "updated": 1605195918306274000
 }
}

How should I build the blocks?
1 Like

Welcome to Thunkable.

You need to convert your JSON string to an object and then use the Get property .... of object .....

See this

The output would be
image

You can also use the JSON reference format this way which will give the same output.

image

I tried but the output is null

1 Like

You’re not showing a full blocks which makes it difficult to know the cause.

Try it again. The part you are showing is OK.

1 Like

same for me it should be ok.
are you sure you are entering in the purple block ? (then do ? )
try to set you label4 with a test string to be sure that you are entering the condition.
can you share your app ?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.