Formatting issues with ChatGPT and Google docs/Email sending

Hello Make’s community,
I wanted to reach out regarding a problem I’ve been encountering with generating text using ChatGPT and sending it via email using Make.
Every time I compose a message, the text isn’t properly formatted to HTML (even if I put HTML format in make), resulting in lines being stuck together and breaks not being properly implemented.
Additionally, I’ve been facing challenges when attempting to copy generated tables directly into Google Docs or emails (via make). The formatting gets lost in the process, making it challenging to maintain the structure of the tables.

I was wondering if anyone else has encountered similar issues and if there are any tips or solutions you could share to improve the formatting of text generated by ChatGPT and sent via Make. Any insights or advice would be greatly appreciated.

Thank you in advance for your help!

Best regards,
Adrien

1 Like

Welcome to the Make community!

I suggest avoid getting GPT to generate HTML-formatted content.

Instead, replace the newlines in plain text using something like this:

<p>{{replace(1.choices[].message.content; "/\n{2,}/g"; "</p><p>")}}</p>

Screenshot_2024-02-14_150208

And for tables, you can Text Aggregate each item into rows, and then manually type the HTML code for the table wrapper

Screenshot_2024-02-14_150251

4 Likes

Hi.

I am new to Make.com and have a similar issue to the original post. I have an OpenAI Assistant that is generating a response and the formatting is coming back with hashtags, asterisks, and without proper line breaks. I’ve tried several different things and nothing is working. Any help would be appreciated.

Welcome to the Make community!

That looks like a new question, could you please create a separate topic for this?

While it’s tempting to hop onto an existing thread, a more effective approach would be to start a new topic just for your question. It helps community experts find and respond to your query quicker, and keeps our space organised for everyone. If you start a new conversation you are also more likely to get help from other users. You can refer others back to a related topic by including that link in your question. Thank you for understanding and keeping our community neat and tidy.

The “New Topic” link can be found in the top-right of the header:

Screenshot_2023-12-19_091207

2 Likes