HTTP Post ; how to handle dynamic payload fields?

I have troubles finding a solution to make a dynamic payload in a function node to be a input for a HTTP (Post) node.

The payload need to be formated like:

msg.payload = {
  "key_1": "value_1"

The "key_1" is a dynamic key and the "value_1" in this example is fixed.

The question is; how do I make the "key_1" string a string that can be filled by a variabele?

let v = "key_1"
let msg.payload = {}
msg.payload[v] = "value_1"

Untested as typed on phone

Thanks! I putted the variable between the brackets "[ ]" and it worked! :slight_smile:

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