Struggling with newline escapes - can't get rid of "\" in results

Hi all, my goal is to parse JSON from an OpenAI GPT response. The GPT module is configured to return valid JSON as specified in the prompt and the response format. And it’s working. Looking at the results in the diagram, I see valid JSON:

{"date":"2024-06-10T21:26:00.000Z","short_summary":"Met with friends and family, discussed personal and friends' challenges, and future plans.","detailed_summary":

However, when I try to parse the JSON in the next module I get a “not valid JSON error.” And if I export the GPT response, I see a lot of newline escapes that I don’t want. Like this:

 {
        "result": "{\"date\":\"2024-06-10T21:26:00.000Z\",\"short_summary\":\"Met with friends and family, discussed personal and friends' challenges, and future plans.\",\"detailed_summary\":\"Saw Joe, Sarah, and June

I’ve reviewed the forum coverage of this and tried everything, namely the replace function prior to the JSON parse, nested replace, use of REGEX, etc. But clearly I’m doing something wrong.

Would love any guidance!

The blueprint is attached.

blueprint (2).json (204.1 KB)

Hi @NewMaker
You can use replace function like this for replacing"\" with empty string:

Tested with the output you proived:
image

If you require additional assistance, please don’t hesitate to reach out to us.
MSquare Support| Book Live Implementation
Visit us here
Youtube Channel

1 Like

Thank you for the idea, but I tried that prior and the problem is that, despite it looking correct in the inspector output, if you actually download the output bundle, the newline breaks are there. Make.com is adding them in the transfer from one module to another.

See this image

1 Like