# Text Removal Issue

**URL:** https://community.make.com/t/text-removal-issue/54892
**Category:** Questions
**Tags:** text-replace, json, functions
**Created:** [September 12, 2024, 10:38pm UTC](https://community.make.com/t/text-removal-issue/54892 "2024-09-12T22:38:34Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Halil\_Faruk\_Kurt](https://avatars.discourse-cdn.com/v4/letter/h/74df32/32.png) [@Halil\_Faruk\_Kurt](https://community.make.com/u/Halil_Faruk_Kurt)
#### Post date: [September 12, 2024, 10:38pm UTC](https://community.make.com/t/text-removal-issue/54892/1 "2024-09-12T22:38:34Z")

</div>

Hi everyone,

I’m working on an automation where I receive a response from the **OpenAI module** in [Make.com](http://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](http://Monday.com) using [Make.com](http://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](http://Make.com), which then creates an item in [Monday.com](http://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.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/0/6/062da5a75363eb0e60b72ec9831e068aea7d27a1.png)

### **What I’ve tried** :

- I used `replace()` functions to remove the unwanted text, but I’m still running into issues when parsing the JSON.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/f/7/f792f3dac40a950cf5daa9acd2f815d14345c218.png)  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/7/8/78419ef16a5875e831ca6afd4453cec8b6f07e35.png)

### **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:

````plaintext
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!
````

---

<div class="post-metadata">

### Author: ![LinkYourTech](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@LinkYourTech](https://community.make.com/u/LinkYourTech)
#### Post date: [September 12, 2024, 11:18pm UTC](https://community.make.com/t/text-removal-issue/54892/2 "2024-09-12T23:18:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)
#### Post date: [September 13, 2024, 12:56am UTC](https://community.make.com/t/text-removal-issue/54892/3 "2024-09-13T00:56:38Z")

</div>

See [Issue with JSON Parsing in OpenAI Response - #2 by samliew](https://community.make.com/t/issue-with-json-parsing-in-openai-response/49289/2)

---

<div class="post-metadata">

### Author: ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)
#### Post date: [December 12, 2024, 2:10am UTC](https://community.make.com/t/text-removal-issue/54892/4 "2024-12-12T02:10:26Z")

</div>


