I am building an automation in Make.com where I use the OpenAI GPT (gpt-4o or gpt-3.5-turbo) module to generate a LinkedIn post in JSON format. The structure includes fields like Title, Content, and hashtags.
I want to parse this JSON response using the JSON module in Make, but I consistently encounter the following error:
“DataError: Source is not valid JSON”
This happens even though the GPT output looks like valid JSON, for example: {
“Title”: “Boost your professional profile with LinkedIn marketing strategies”,
“Hashtags”: [“linkedin”, “#Marketing”, “#DigitalStrategy”],
“Content”: “Learn how to elevate your LinkedIn game with proven marketing strategies designed to enhance your professional brand. Join us for an exclusive webinar on boosting your visibility and engagement on LinkedIn. Don’t miss out on this opportunity to leverage the power of LinkedIn for career growth!”,
“Link”: “https://www.linkedin.com/webinar-linkedin-marketing-strategies”
}
ChatGPT want me to to insert extra tools like Set variable. Is it the right way?
Steps taken so far
Changing GPT 4o to 3.5 Turbo, different User Prompt in OpenAI module, different JSON string.
Hi Adelina_Arendarska The error I’m seing is that you are not calling the data in the right way. Use this text {{9.choices[0].message.content}} in the ParseJSON module instead, you will see that is different than a normal text and delete the setvariable module
To resolve the “DataError: Source is not valid JSON” issue, you need to make sure the JSON generated by the GPT module is strictly valid, without any extra content or formatting issues.
Solution:
Step 1. Add a note in the prompt:
NOTE: The output result should be strictly in JSON without any additional content, and it should return the output in the following structure:
{
“Title”: " “,
“Hashtags”: [” "],
“Content”: " ",
“Link”: " "
}
openAI User promot: Based on the input, generate a LinkedIn post structure as valid JSON.
Important:
Return only valid JSON.
Do not include any explanations, markdown, or text outside the JSON.
The response should start and end with curly brackets {}.
Example format:
{
“Title”: “”,
“Hashtags”: [“”],
“Content”: “”,
“Link”: “”
}
Only respond with valid JSON. Do not add any explanation or text outside of the JSON object.
If you add anything else, it will break the automation.
NOTE: The output result should be strictly in JSON without any additional content, and it should return the output in the following structure:
{
“Title”: " “,
“Hashtags”: [” "],
“Content”: " ",
“Link”: " "
}
Now generate JSON based on this input:
{{7.choices[0].message.content}}
BundleValidationError
Validation failed for 1 parameter(s).
Missing value of required parameter ‘json’.
Output
Bundle 1Collection
Result
{ “Title”: “Boost Your LinkedIn Marketing Strategy with These Top Tips!”, “Hashtags”: [“LinkedInMarketing”, “DigitalMarketing”, “SocialMediaTips”], “Content”: “Are you looking to enhance your LinkedIn marketing game? Check out these top tips to elevate your strategy and connect with your audience effectively!”, “Link”: “https://www.linkedin.com/marketing-tips” }
" * GPT may return valid JSON as a string or an object, depending on:
Model version (e.g. gpt-3.5-turbo vs gpt-4o)
Slight differences in how you word your prompt
Hidden Make behaviors (how it treats message.content internally)
That’s why it works “sometimes” without help — and sometimes fails, even if the JSON looks perfect." Is that really true???
can you show us the configuration of the Chat GPT module before the parse JSON one? Did you toggle the setting for it to return a JSON or just asked for one in the prompt?