In data integrations, matching data types between the source and the destination tool is crucial. Proper setup in Bubble is essential for correctly interpreting data, particularly when dealing with unpredictable data structures, like those from a relational database like we explore in the SmartSuite plugin tutorial.

Eli introduced a concept of 'virtual data types' a few years ago (find out more here). This approach involves giving Bubble a sample format to properly handle incoming data. Users can create this format either within your plugin or externally. After setting it up, their next step is to upload it into Bubble. The rest of this guide will detail methods for generating these formats and explain how users can implement them.

Why not rely solely on the API Connector?

You might be wondering why there's a need for these steps and why the Bubble's API connector isn't sufficient.

The API connector is effective when the data format is consistent every time. However, in cases where we’re pulling information from a data source where users may have various combinations of columns and types, the format becomes unpredictable.

In such scenarios, the API connector isn't suitable for a generalized format approach.

1. Generating “virtual data types”

Generating virtual data types with external tools

There are various methods to generate the formats needed for Bubble plugins, and it's not always necessary to create an element or action within Bubble itself; this is more about adding convenience. Users can alternatively utilize external tools like Postman or Hoppscotch.

Additionally, if the tool you're integrating with provides a sample format, you can direct your users to use this as part of their setup. This approach is exemplified by the Xano Bubble connector. As Xano allows users to test API calls directly from Xano documentation, they can conveniently acquire the sample format needed from there.

Using the plugin to generate the virtual data type

You can also generate formats directly within the plugin. This method involves initiating a call to the service and then using all or part of the response as an example format. We use this approach in the How to build a SmartSuite plugin tutorial.

Handling the virtual data type from a Plugin

Handling the format once it's returned can vary. If using Bubble elements, a 'copy to clipboard' action can be integrated. For server-side actions, the format is returned as a value, necessitating user configuration on their Bubble page for access.

In our How to Build a SmartSuite Plugin tutorial, we showcase a server-side action that returns the format, which users then set up on a Bubble page. Here's an overview of this process:

First, users need to add the “API Connector” plugin for importing our table format.