Hey. I need to add {{variable}} to text, calling external API via HTTP node

Hello everybody!

Couldn’t find answer here or in docs. I need to send string to external API via HTTP node, that includes ‘{{variable}}’ string, that will trigger this API to add the value. But n8n perceive it ask own dynamic value and breaks the expected functionality. Kindly advice how to still include it.

Thanks!

Regards,

Dan

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

@Dan_Burykin , you could compose your string as string, for example, with a Set node, using Text mode. This way the string {{}} will not be interpreted as an expression.

Similarly, you will achieve the same in Code by returning the string as in

return {
  text: "Text with {{ variable }}"
};

If on the other hand the “variable” is actually the value that need to be taken from a previous item’s property, it could be achieved with a bit of a hack as demonstrated below (not sure if there is a more elegant way of doing it). The main point in there is to have opening curly brackets constituting the expression as a value in the item’s property alongside the item’s property that holds you actual “variable”.

1 Like

It worked. Thanks a lot, @ihortom

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