I don't want the use of {{ in JSON to be interpreted as mapping

Hello everyone

As you will see below in the JSON, I first need to define a variable.

{
  "type": "image",
  "width": 1080,
  "height": 1080,
   "bgImageUrl": "https://example.com/image/example.png",
   "text": "Happy Coffees!",
   "textBgColor": "green"
  },

Later, I need to call this variable again within the same module or even within the same piece of code.

    "background": [
            "url": "{{bgImageUrl}}",
            "type": "image"
          ]

However, when I use {{ to call this variable, Make.com interprets it as mapping and I am not able to call the variable in the code snippet. Is there a way to do this?

Welcome to the Make community!

Try using the replace function to replace %%bgImageUrl%% into {{bgImageUrl}}

e.g.:

Screenshot_2024-09-01_180932

Example output string

Screenshot_2024-09-01_180944

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

1 Like

Thank you. But is there any other way? Because variables are not consistent, changing for every runs so i can’t control the variable names that way.

Just insert the variable name as a variable where the word variable is at in my example.