I'm creating the JSON array in a variable and then including that in the response body. (substring is just to strip the final line break and comma, cause that append is in a loop)

If I show that 'galleryItems' variable (including the substring) in a label, then copy and paste the data into the array as raw data - the gallery populates as expected.


However, when I assign the exact same var to be the array in the JSON the gallery table shows as empty. Any ideas about what I'm missing?
With raw data:

With the variable:

Edit. just in case it helps this is the schema for the response action:
{
"type": "object",
"properties": {
"json": {
"type": "string"
},
"responseCode": {
"type": "string"
},
"galleryItems": {
"type": "array",
"items": {
"type": "object",
"properties": {
"fileName": {
"type": "string"
},
"fileUrl": {
"type": "string"
}
},
"required": [
"fileName",
"fileUrl"
]
}
}
}
}