Text Removal Issue

Hi everyone,

I’m working on an automation where I receive a response from the OpenAI module in Make.com, which outputs data in the following format:

{
“job_title”: “Connect Line bot to already existing line channel”,
“job_description”: “Hey, Context: I’m trying to create an integration between Line and Monday.com using Make.com. The setup is supposed to trigger whenever someone sends me a message via Line, and the webhook sends the data to Make.com, which then creates an item in Monday.com…”
}

The issue:

  1. The response sometimes includes unwanted characters like ````json` and newline characters, which need to be removed.
  2. I want the JSON object to be correctly formatted and parsed so that I can work with it in Airtable.

What I’ve tried:

My goal:

  • I want to extract the JSON from the OpenAI response, ensure it’s in valid JSON format, and then pass it to the Airtable module without errors.

I need to extract this JSON data, remove the extra backticks (json and ), and then parse the JSON so I can send it to Airtable.

I’ve tried using the following formula in the JSON Parse module:

replace(replace(3.Result; "```json\n"; ""); "```"; "")

Has anyone encountered a similar issue or have advice on the best way to handle this?

Thanks in advance!

I think it would save you alot of headache to use the structured text module. It will give you a conisistent result.

See Issue with JSON Parsing in OpenAI Response - #2 by samliew