Hello,
I’m using a mustache template node to populate a value from the flow context.
"{{{flow.config.name}}"
This works as expected.
However, when I store multiple objects within the flow context using a variable, is there a way of using that in the template node?
msg.contextName = "foo";
const contextName = msg.contextName;
msg.payload = {
"name": "bar"
}
flow.set(`config.${contextName}`, msg.payload);
msg.contextName = "bar";
const contextName = msg.contextName;
msg.payload = {
"name": "foo"
}
flow.set(`config.${contextName}`, msg.payload);
I now have two objects in my config flow context.
{{{flow.config.foo.name}}
{{{flow.config.bar.name}}
I can use a change or function node to set these values before the template node. Ideally, it would be nice to use directly within the template,
I have tried the following without success.
{{{`flow.config.${msg.contextName}.tenantname`}}}
{{{`flow.config.${contextName}.tenantname`}}}
{{{flow.config[contextName]tenantname}}}
Thanks in advance.
Harry