Impossible to convert Json to text - Json is sent by API

When I try to convert Json to text it is Tested Successfully but Output is “undefined”

This is what I am trying to do:
I send a http request to call an API

The API returned a json code with success formated like this. It’s a Json inside a Json
answer : ```json\n{\n"destinataire": "",\n"sujet": "Proposition

Even when i try to convert the first json, it is Tested Successfully but Output is “undefined”

I am prompting an AI API asking to personalise some text returning a json format.
I can ask the AI to format it in a different way knowing that I generate a subject in different languages and an email body in the same language as the subject.

How can I get my email suject and email body? to the send email piece ?

This is additional information :

Hello @labaude , Welcome to the community :wave:,

The answer field is not a valid JSON string. It also has ‘json’ as a prefix, which would cause an error if you attempt to convert this string to JSON.

If the AI API returns an answer like answer : ‘{"destinataire":""}’* , you can use a text-to-JSON action to convert it properly. This will make it easier to map the email subject and body in the next steps.

Thank you for this answer. I will contact the AI company who then return a wrong data format. When i use the front end, no issue, json is valid.

I have to dig into this :slight_smile:

@labaude, could you please share a sample response that doesn’t contain confidential data? I’d like to check if we can use any Text Helper action to convert it to JSON.