diff --git a/src/backend/variables/builtin/array-element.js b/src/backend/variables/builtin/array-element.js index de74f482a..9f7562ddb 100644 --- a/src/backend/variables/builtin/array-element.js +++ b/src/backend/variables/builtin/array-element.js @@ -15,6 +15,11 @@ const model = { if (jsonArray) { const array = utils.jsonParse(jsonArray); if (Array.isArray(array)) { + // Check value for being array or object, otherwise return raw value + if (Array.isArray(array[index]) || Object.prototype.toString.call(array[index]) == "[object Object]") + { + return JSON.stringify(array[index]); + } return array[index]; } } @@ -22,4 +27,4 @@ const model = { } }; -module.exports = model; \ No newline at end of file +module.exports = model;