Help expressing a value in Json?

This is an existing issue, I don't think I'm asking the question properly.

I have no issue capturing the data or sending data to my controller. My issue is I cant seam to figure out how to send my captured date (payload) to my output string. what i need to automate is the changing of the "value"

The string I send to my controller is

Json

What ever I set in "value": "X" presently ( "value": "85"), get written no issues.

how do i make this my payload value?

The quick way is to change the 5 to say msg.payload, then change the type of the field in the Change node rule to be Expression rather than JSON

1 Like

What you have shown is static JSON. You need something dynamic. You have a number of choices.

One way would be to use the JSONata feature instead of plain JSON. That would let you substitute payload as a property instead of your fixed "85" string.

Another way would be to have 2 changes in your change node. The first to create the JSON and the second to set msg.payload.propertyReferences[0].value to `payload1.

UPDATE: My first example is what Nick just described.

Perfect, Got it...

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.