Learn Bubble with 500+ tutorials, courses & AI Assistant ✨

Limited time launch offer get $80 off today

0 days 0 hours 0 minutes 0 seconds
SAVE $80 NOW
Planet No Code logo
Bubble.io CoachingFounder MentoringSponsorships
LoginLearn Bubble.io

Using JSON-safe with Bubble.io and the OpenAI API

This Bubble tutorial is a follow up to our ChatGPT chatbot video where we demonatrated to how create a conversation with the OpenAI API using GPT-3.5-turbo. This videos demonstrates an improvement to our initial chatbot by using the Bubble.io text modifier :formatted as JSON-safe. This can solve many of your JSON syntax errors and OpenAI API errors by correctly escaping punctuation and formating your text input.

Join now $19/monthLearn more
Get 500+ tutorials, a No-Code AI Assistant, 4 premium courses, and everything you need to build faster!
Using JSON-safe with Bubble.io and the OpenAI API
Explore these topics...
Database
Plugins
OpenAI
formatted as JSON-safe

With just this tutorial learn...

Master JSON safe formatting: Unlock the power of OpenAI in your Bubble app with this essential technique!

Escape punctuation like a pro: Learn how to avoid API errors and seamlessly integrate API connections in your no-code projects.

Bubble's JSON safe magic revealed: Discover the secret to sending complex data structures without syntax headaches!

With membership you'll...

Learn how to build a ChatGPT Clone, Custom CRM for your business & SaaS Marketing website with Webflow & AI.

Unlock 500+ Bubble tutorial videos with AI powered Q&A.

Debug your Bubble app instantly with our custom trained No Code AI Assistant.

Join now $19/month
Risk-free! 14-day money-back guarantee. Cancel anytime.

Introduction to JSON-safe Formatting in Bubble.io

We've had a lot of great responses from our ChatGPT chatbot video and quite a few questions around using the API connection Bubble and JSON safe and JSON syntax. So I want to create a video showing how to use the text modifier formatted as JSON safe and this forms a good follow-up video to our ChatGPT chatbot video.

Demonstrating JSON-safe Formatting

To demonstrate it, I'm just going to add a text label here. To understand everything that I've built here, check out our ChatGPT chatbot video. Diving in with this, if I look at the multi-line input value and then I say formatted as JSON safe and then we preview that, you'll see that as I start to type it puts everything within speech marks. If I start putting some punctuation elements into the multi-line text input here, it formats those in a JSON safe way.

Understanding JSON Formatting

In many instances, the term kind of from traditional coding is that it escapes punctuation. This is where the problem is introduced: the format that OpenAI expects for their API text generator is JSON like this. You have a number of different fields or parameters here, and they're all kind of a combination of a label in speech marks and then the data to go along with that label. You also have arrays here so you can list more than one element.

The Importance of Proper JSON Syntax

The point is that you can't just go around putting speech marks anywhere you like in JSON or commas outside of speech marks anywhere you like because you will get a syntax error. You'll get an error back from the API, and so using formatted as JSON safe is one way to get around that.

Using JSON-safe Formatting in Practice

Let's illustrate that here by saying, "Well, sometimes I do want to send speech marks to OpenAI because it might be a way of highlighting." You could have a "summarize this text" and you'll want to send a colon and you'll also want to send some speech marks "hello world". You can see that Bubble has done a number of really helpful things here. It has added the backslash n to symbolize the two line spaces I've got, and it adds a backslash before the speech marks which are to be treated as speech marks and are not to be misinterpreted as speech marks within JSON.

Modifying the Initial Workflow

This allows me to modify my initial workflow. Again, if you're unsure about any of this, go and check out the full video. I want to change this here to JSON formatted as JSON safe, but I also (and this is where I've seen and it's caused me a number of headaches in the past) it gives you the speech marks. So at the moment, I'm going to get double speech marks here, so I changed that and I remove that.

Testing the Modified Workflow

Now let's test it. What could I have as a good follow-up to this conversation going on here? I could say "tell me five facts about" and then there's not a good reason to do this, but to demonstrate that the speech marks are made JSON safe, I'm just going to put "the shard" in speech marks and let's have a go.

Reviewing the API Response

We're waiting for a response from OpenAI and there we go, we've got our response back. I've not got an error, nothing has popped up as a browser prompt saying that OpenAI's API has returned an error.

Examining the Database

Perhaps this is something that I should have included in my initial video to make it an even better demonstration. I just wanted to demonstrate to you how JSON formatted as JSON safe can solve a lot of your problems with JSON syntax and then also how to use that properly with Bubble. If I go into the database, I can just show you what's going on there with I think it's messages here.

Verifying JSON Syntax in the API Connector

The JSON that I sent is here and you can see that it escapes the speech marks around "the shard" but it puts in the speech marks needed to indicate what is the content. So then if I go back into the API connector, we can see that as a message to go in my messages, it's all correct. There are no syntax errors.

Troubleshooting JSON Syntax Errors

If you are getting additional syntax errors, do go into your database. Check that your punctuation is being escaped, check that you've got formatted as JSON saved correctly, and that there aren't any issues with it. I would also check what you've got in this box here, that you've not got a comment out of place. Simplify all the way down to the bare essentials, get it working, and then begin to add in extra parameters, extra messages.

Conclusion and Further Assistance

If you've got a question about using the OpenAI API Bubble, leave it in the comments. We read every single one of them.

Table of contents

Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Your No-Code Journey Starts Here

The best way to learn Bubble.io?

Build No Code Confidently

No more delays. With 30+ hours of expert content, you’ll have the insights needed to build effectively.

Find every solution in one place

No more searching across platforms for tutorials. Our bundle has everything you need, with 500+ videos covering every feature and technique.

Dive deep into every detail

Get beyond the basics with comprehensive, in-depth courses & no code tutorials that empower you to create a feature-rich, professional app.

Monthly
Yearly
Member
Accelerate your Bubble app to launch
$99 / month
$19/month/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now
Member
Accelerate your Bubble app to launch
$990 / year
$149/year/mo
Includes:
500+ tutorials
4 premium courses
Find the right tutorial with our custom trained AI
New tutorials added each week
Cancel anytime
14 day money back
Join now

Frequently Asked Questions

Find answers to common questions about our courses, tutorials & content.

Do I need any coding experience?

No. Our Beginner Essentials course and AI No-Code Coach are designed for total newcomers. You’ll learn Bubble.io step by step - no coding required.

How does the AI No-Code Coach work?

Simply type your question in plain English, and our AI taps into the entire video library to recommend the exact lessons you need. It’s like having a personal instructor on demand.

How long can I access the content?

As long as you’re subscribed! With our monthly subscription, you get unlimited access to all 500+ videos, our growing course library, and the AI No-Code Coach.

What courses are included

Your subscription includes:

  • Bubble Beginner Essentials – Get up and running fast.
  • Build a ChatGPT Clone – Integrate AI into your no-code apps.
  • Build Your SaaS Website with AI – Learn to create a scalable startup site.
  • Develop a Custom CRM App in Bubble - Learn database relationships with a CRM.

Plus, new tutorials every week!

What if I get stuck on a lesson?

The AI No-Code Coach is your first stop for instant answers. If you need deeper help, you can book 1:1 Bubble coaching for expert guidance.

Do you offer a money-back guarantee?

Yes! If you don’t see real progress within 14 days, let us know, and we’ll issue a full refund—no questions asked.

Can I cancel anytime?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

What if I want more than just tutorials & courses?

Absolutely. Your subscription is month-to-month, and you can cancel anytime—no lock-ins, no hidden fees.

If you’re serious about building a successful SaaS startup, check out Mastery—our intensive mentorship program. Mastery goes beyond Bubble.io development and includes:

  1. 1:1 mentorship to fast-track your progress
  2. Marketing strategies tailored for no-code founders‍
  3. Product management insights to scale your startup‍
  4. Personalized support from experienced founders

‍

Still have questions?

Reach out to our dedicated team.

Contact
Services
Search Bubble TutorialsBubble.io CoursesBook Bubble.io CoachingApply for Mastery
Latest Bubble tutorials
Rerank Text By MEANING With Cohere In Bubble.io Step by Step!
Unlock RAG Providers for NO CODE AI App Development TODAY!
Better Tables with Built-in Search and Sort By in Bubble.io
Partnerships
Flusk.eu
VectorShift
Comnoco
Plumb
Toddle
Whereby
Get started with no code
AI Powered No Code AppsNo Code Web ScrapingBubble.io Plugin tutorialsBubble API Connector tutorialsStudent & Teacher DiscountBest tools for no coders
Follow us
Youtube
X
LinkedIn
Planet No Code logo
In partnership with
Queen Mary University of London Logo
© 2024 Planet No Code. All rights reserved.
Privacy PolicyTerms of ServiceCookies SettingsContact Us