Replacing/Escaping double quotes

I’m trying to pass Json with an ahref/URL in a string, but the Double quotes are presenting a problem. I thought I could use something as simple as this but obviously the quotes with inside the function don’t work.

replace("{{45.call_html}}", """, "\"")

What’s another workaround?

Are you trying to replace double quotes… with double quotes?

Perhaps screenshots might explain things better.

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Input/Output bundles

Please provide the input and output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
Screenshot_2023-10-06_141025

A.

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading them here will look like this:

module-1-input-bundle.txt (12.3 KB)
module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like

Sorry I had to wrap it in code, as it did show the escape in post.

replace("{{45.call_html}}", """, "\"")

The problem is, I’m trying to pass a value {{45.call_html}} within the body of JSON. The value has a html/URL with quotes in it, so I need to make sure that the value {{45.call_html}} replaces quotes with an escape code before the quote.

Or so I think this will solve my problem.

One way is to use the JSON “Transform to JSON” module first with the HTML/content you want to insert into JSON later.

Input:

Screenshot_2024-05-21_143930

Screenshot_2024-05-21_134147

Map the output variable into the JSON field:

Output, properly escaped string:

Screenshot_2024-05-21_140751

Screenshot_2024-05-21_140751

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

2 Likes

Thanks for this, this solved my problem!

1 Like