HTTP Request (body problem)

Hi I can’t seem to fix this mistake in the http request. When the first bit of the body is correct the "{{LOGO}} shows as undefined (already checked everything, the problem is 100% on how the expression is written but lack the knowledge to rewrite it correctly and ChatGPT is looping into the same text that doesn’t fix the problem. Somethime the body text changes to “invalid syntax” please helppppp

What is LOGO supposed to represent, where is that value coming from?

Share an example of what it looks like on the input side of that node, showing where LOGO is after the last node ran.

Hey! Thanks for the reply :folded_hands:
{{LOGO}} is a text placeholder inside my Google Slides template. I manually added that text in a shape/text box and I want to replace it with an image pulled from Airtable.

The Airtable data comes through a “Search Records” node. That node contains a field called Logo, which is an array that looks like this:

"Logo": [
  {
    "url": "https://example.com/image.png"
  }
]

Then, in the HTTP Request node, I try to send this request to Google Slides:

{
  "requests": [
    {
      "replaceAllShapesWithImage": {
        "imageUrl": "{{$node[\"Search records\"].json[\"fields\"][\"Logo\"][0][\"url\"]}}",
        "replaceMethod": "CENTER_INSIDE",
        "containsText": {
          "text": "{{LOGO}}",
          "matchCase": true
        }
      }
    }
  ]
}

But when I run it, it either shows that "{{LOGO}}" is undefined or throws a syntax error (in the “imageUrl bit”. I’m trying to make sure that Google Slides replaces that placeholder with the image URL coming from Airtable.

ooh, it’s because the {{ }} is a special character combination for n8n, so it is trying to resolve that to something, not send it ‘as is’.

You could try to escape those characters, it should work as they would be the same characters to escape json itself, but I’m not 100% sure this would work.
\{\{LOGO\}\}

You might consider using a different token for your google sheets replacement, to avoid this problem completely.

Thanks, but it still doesn’t work :frowning: I don’t understand the differnet token solution. Why would this void the problem completely?

Ahh, try this:

{{ “\{\{LOGO\}\}” }}

Thanks for the help! It didn’t work, but I fixed it adding another set node to isolate the info I wanted to make the expression much simpler (not ideal but it was the only way I could make it work lol)

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