# PARSE.json is providing empty values

**URL:** <https://community.n8n.io/t/parse-json-is-providing-empty-values/25765>\
**Category:** Questions\
**Tags:** data-transformation, set\
**Created:** [May 1, 2023, 6:07pm UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765 "2023-05-01T18:07:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![RomainMaltrud](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/romainmaltrud/32/24373_2.png) [@RomainMaltrud](https://community.n8n.io/u/RomainMaltrud)\
**Post date:** [May 1, 2023, 6:07pm UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/1 "2023-05-01T18:07:33Z")

</div>

Hi there,

I’m trying to parse some JSON, but it gives me an empty value. I don’t understand why, as I saw in another thread, [the same problem was resolved with this javascript](http://community.n8n.io/t/parse-json-into-individual-items/24016).

Here is the problem that I am facing :

 ![CleanShot 2023-05-01 at 20.03.18@2x](https://europe1.discourse-cdn.com/n8n/original/3X/3/3/33f9156b1ecda88168529496d1af7732ce5c7233.png)

 ![CleanShot 2023-05-01 at 22.22.40@2x](https://europe1.discourse-cdn.com/n8n/original/3X/c/5/c522fb3eae09c2b2dd575490a40681a59d51e075.png)

Does anyone have an idea about how I could get the correct data?

Thank you very much!

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [May 1, 2023, 6:49pm UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/2 "2023-05-01T18:49:39Z")

</div>

Hi @RomainMaltrud

I think you are looking for JSON.parse()

---

<div class="post-metadata">

**Author:** ![RomainMaltrud](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/romainmaltrud/32/24373_2.png) [@RomainMaltrud](https://community.n8n.io/u/RomainMaltrud)\
**Post date:** [May 1, 2023, 8:25pm UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/3 "2023-05-01T20:25:06Z")

</div>

Hi @BramKn, thank you very much for your help.

I’ve tried JSON.parse, but still have the same error :

 ![CleanShot 2023-05-01 at 22.22.40@2x](https://europe1.discourse-cdn.com/n8n/original/3X/c/5/c522fb3eae09c2b2dd575490a40681a59d51e075.png)

---

<div class="post-metadata">

**Author:** ![BramKn](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/bramkn/32/11894_2.png) [@BramKn](https://community.n8n.io/u/BramKn)\
**Post date:** [May 1, 2023, 8:31pm UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/4 "2023-05-01T20:31:26Z")

</div>

![image](https://europe1.discourse-cdn.com/n8n/original/3X/1/2/12e851bc0df78c1dc7709c939f4ec56b7844eec4.png)

It should work like this.  
So Probably something else is wrong. Can you show the input and the workflow?

---

<div class="post-metadata">

**Author:** ![RomainMaltrud](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/romainmaltrud/32/24373_2.png) [@RomainMaltrud](https://community.n8n.io/u/RomainMaltrud)\
**Post date:** [May 1, 2023, 8:40pm UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/5 "2023-05-01T20:40:43Z")

</div>

You’re absolutely right. This is why I don’t understand why it gives me empty values 😅

This is my workflow :

 ![CleanShot 2023-05-01 at 22.35.53@2x](https://europe1.discourse-cdn.com/n8n/original/3X/2/6/265849c45efdd65fdf8266e6df3b28ca504fa37a.png)

I’ve asked to ChatGPT to provide me JSON results and I’d like to list the “sujets” items like for example :  
[  
{  
“Id”:“1”,  
“nom”:“Définition des OKR”,  
“description”:“Explication de ce que sont les OKR et comment ils fonctionnent”  
}  
]

My problem appears in the last node. Here is the JSON input :

[  
{  
“message”:  
{  
“role”:“assistant”,  
“content”:  
“{ “sujets”: [{ “id”: 1, “nom”: “Définition des OKR”, “description”: “Explication de ce que sont les OKR et comment ils fonctionnent” }, { “id”: 2, “nom”: “Comment établir des objectifs ambitieux mais réalisables”, “description”: “Conseils pour définir des objectifs qui stimulent la croissance tout en étant atteignables” }, { “id”: 3, “nom”: “Comment aligner les OKR avec la stratégie de l’entreprise”, “description”: “Méthodes pour s’assurer que les objectifs individuels soutiennent les objectifs globaux de l’entreprise” }, { “id”: 4, “nom”: “Comment mesurer le succès des OKR”, “description”: “Indicateurs clés de performance à utiliser pour suivre la progression vers les objectifs fixés” }, { “id”: 5, “nom”: “Comment impliquer tous les membres de l’équipe dans le processus d’OKR”, “description”: “Stratégies pour encourager la participation et l’engagement de tous les membres de l’équipe dans la définition et la réalisation des OKR” }, { … }] }”  
},  
“finish\_reason”:  
“stop”,  
“index”:  
0  
}  
]

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [May 2, 2023, 6:22am UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/6 "2023-05-02T06:22:32Z")

</div>

Hey @RomainMaltrud,

Is that the full input data? My first thought is maybe the json is invalid.

---

<div class="post-metadata">

**Author:** ![RomainMaltrud](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/romainmaltrud/32/24373_2.png) [@RomainMaltrud](https://community.n8n.io/u/RomainMaltrud)\
**Post date:** [May 2, 2023, 7:40am UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/7 "2023-05-02T07:40:38Z")

</div>

Hey @Jon,  
Thanks for your answer (and thank for all your answer - you’ve already helped me a lot in other threads).

Correct, this is the full input data generated by Chatgpt.

You mean that this part of the Json is invalid ?

“{ “sujets”: [{ “id”: 1, “nom”: “Définition des OKR”, “description”: “Explication de ce que sont les OKR et comment ils fonctionnent” }, { … }] }"

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [May 2, 2023, 1:09pm UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/8 "2023-05-02T13:09:11Z")

</div>

Hey @RomainMaltrud,

Yeah so that has `{…}` in it which may not be valid.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [July 31, 2023, 1:09pm UTC](https://community.n8n.io/t/parse-json-is-providing-empty-values/25765/9 "2023-07-31T13:09:20Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
