Multiple issues with Respond to webhook , JSON. Sometimes although , the response body evaluates the expression successfully ( i can see it in results window), the output still throws an Invalid JSON in the response body
{
"success": true,
"title": "Comprehensive Eyecare Routine for Screen Users",
"prompt": "Create a comprehensive, step-by-step daily and weekly eyecare routine tailored for individuals who spend extended hours in front of digital screens. The guide should specifically include:
1. Eye exercises to reduce eye strain and improve focus flexibility.
2. Proper care instructions for bi-weekly disposable contact lenses.
3. Best practices for cleaning and maintaining reading glasses.
4. Screen ergonomics: Ideal settings for brightness, contrast, and blue light filters.
5. Workspace lighting recommendations to minimize glare and eye fatigue.
6. Recommended screen time management strategies and rest schedules (e.g., 20-20-20 rule).
7. Nutrition and hydration tips to support overall eye health.
Organize the routine clearly into daily and weekly actions, with an emphasis on prevention and long-term ocular wellness.",
"refinement_type": "clarity",
"user_feedback": "Focus on eye exercises, lens care, especially bi-weekly disposable lenses, reading glasses care, screen time etc"
}
When you use this json in expression, add .toJsonString(), which will take care of your problem.
Here is an example for your json with and without using .toJsonString(), see how it works.