From 4b4e5a0861b7d1bfa030f9048024b6416c5575bf Mon Sep 17 00:00:00 2001 From: Hiroyasu Nishiyama Date: Fri, 27 May 2022 11:44:56 +0900 Subject: [PATCH] fix JSONata evaluation of inject button --- .../node_modules/@node-red/nodes/core/common/20-inject.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.js b/packages/node_modules/@node-red/nodes/core/common/20-inject.js index 92b8122df..734bce765 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.js +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.js @@ -109,9 +109,10 @@ module.exports = function(RED) { if (!property) return; if (valueType === "jsonata") { - if (p.exp) { + if (p.v) { try { - var val = RED.util.evaluateJSONataExpression(p.exp, msg); + var exp = RED.util.prepareJSONataExpression(p.v, node); + var val = RED.util.evaluateJSONataExpression(exp, msg); RED.util.setMessageProperty(msg, property, val, true); } catch (err) {