How to read results from JSON Template columns in a JS column

I have a JSON template column with the following settings:

The $SITE and $ACTION properties are both JSON Object columns, but the $HOURS and $MATERIALS columns are lookup columns that contain multiple JSON Objects.

The output of this JSON Template column is something like:

[
{
“ItemCode”: “SiteVisit”,
“Description”: “Site Visit Fee - 22/9/25”,
“Quantity”: 1
},
{
“ItemCode”: “100-Harry”,
“Description”: “Labour p/hr - Harry - 11:00am - 1:45pm = 2.75hrs”,
“Quantity”: 2.75
},
{
“Description”: “Lawns: Sprayed lawns. Weeds\n\nGardens: Hedge, Prune, Tip-Prune, Clipped, Cut. Hedges\n\nHard surface: Sprayed Weeds.\n\nOther: Left cuttings in garden beds for client”
},
{
“ItemCode”: “GM-Roundup”,
“Quantity”: 0.5
}
]

However, when I try to read this column in a JavaScript column, I’m getting “undefined”:

{“type”:“undefined”,“isNull”:false,“isUndefined”:true,“isEmpty”:false}

Is this working as expected? Is there anything special I need to do to access the JSON Template column from a JS column?

1 Like

You are passing JSON to the JavaScript column, so you need to parse that first. ie. with JSON.parse(p1).

2 Likes