Thank you! The fields are coming through with quotes, so as strings.
I’m not able to get the parseInt to work though.
If I do {{parseInt($node["Google Analytics"].json["total"])}}
or {{ parseInt($json.total) }}
or, without the parseInt just {{$node["Google Analytics"].json["total"]}}
it gives the error, “ERROR: Couldn’t find the field ‘286’ in the input data.” (Sub “286” for whatever number is in the “total” field).
That’s why I was using the “total” field as “Fixed” rather than as an expression in the Item Lists node, because it didn’t work as an expression.
Here’s some sample data from Google Analytics when the “Simplify” option is on, maybe it’s formatted weird?
[
{
"ga:pagePath":
"/",
"total":
"286",
"ga:pageTitle":
"My Site"
},
{
"ga:pagePath":
"/?post_type=post",
"total":
"3",
"ga:pageTitle":
"My Site Another Page"
},
{
"ga:pagePath":
"/about-us,
"total":
"1",
"ga:pageTitle":
"My Site About"
},
{
"ga:pagePath":
"/contact,
"total":
"1",
"ga:pageTitle":
"My Site Contact"
}
]
And if I don’t have “Simplify” on in the Google Analytics node, it comes through like:
[
{
"columnHeader": {
"dimensions": [
"ga:pagePath",
"ga:pageTitle"
],
"metricHeader": {
"metricHeaderEntries": [
{
"name": "total",
"type": "INTEGER"
}
]
}
},
"data": {
"rows": [
{
"dimensions": [
"/",
"My Site"
],
"metrics": [
{
"values": [
"293"
]
}
]
},
{
"dimensions": [
"/about",
"My Site About"
],
"metrics": [
{
"values": [
"3"
]
}
]
},
{
"dimensions": [
"/contact,
"My Site Contact"
],
"metrics": [
{
"values": [
"1"
]
}
]
},
{
"dimensions": [
"/another-page",
"My Site Another Page"
],
"metrics": [
{
"values": [
"1"
]
}
]
}
],
"totals": [
{
"values": [
"1003"
]
}
],
"rowCount": 189,
"minimums": [
{
"values": [
"1"
]
}
],
"maximums": [
{
"values": [
"293"
]
}
]
}
}
]```