Hello, I am setting up a workflow starting with watch emails where the body of the email has JSON text. Then I am trying to input the body of the email (shich is JSON text) into a prompt to send to Gemini that will then complete a task and then return JSON that I can parse out in the following step. The gemini response tells me that it is not recognizing the dynamic input that I am giving it to use. This one just made something up completely and the previous time it was returning the example that I gave it in the prompt instead of the dynamic input from the previous step’s output. can you please help? I am new to Make and trying to figure it out.
Hey, the variable you mapped in is actually not raw json, you need to use a module in between if you need actual JSON:
Gemini outputs those pesky ```json ```
markdown formatting, so you CANNOT directly use the Transform to JSON module.
First, you will have to use the built-in function replace
—
{{ replace(text; search_string; replacement_string) }}
For more information, do view these similar questions previously asked by other community members, which may answer your question:
- Strip the code block markdown - #3 by samliew
- Need to remove the "bad characters" from the start of a JSON output from GPT - #2 by samliew
Hope this helps! Let me know if there are any further questions or issues.
— @samliew