Concatenation inside formatting

Not being a coder I lack some skills....

How to you concatenate a variable with a string in this context (function).
I am trying to concatenate VTS which is a float with VC1 which is a string

VTS=(k[9])
msg.payload ={VTS + 'VC1':k[1]}

msg.payload[VTS + "VC1"] = k[1];
or
msg.payload = {[VTS + "VC1"]: k[1]};

one adds a property to payload, the other over writes payload.
[edit] I would add that a property name with a . in may cause issues later on, so might be better to avoid this.

1 Like

Thank you!

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