Weather Underground JSON Problem

I am trying to get rainfall forecast in inches as follows:

local response = http.jsondecode(res.body);
local rainfall = response.forecast.simpleforecast.forecastday[1].qpf_allday.in
Squirrel doesn’t like the last element .in

It works fine with .mm:
response.forecast.simpleforecast.forecastday[1].qpf_allday.mm

Is there another way to reference [in]?

Your problem is that in is a squirrel reserved keyword. To access that element use the syntax response.forecast.simpleforecast.forecastday[1].qpf_allday[“in”]. This is the array syntax alternate method of accessing tables.

Perfect! Thank you very much!