💾Data Schemas

From v4.4.0, we have added to the plugin the possibility of linking "data types" do documents read from a Firestore Data List, Firestore Data Single or Firebase Auth (Current User) elements.

Since v4.5.0, Firebase Data Extractor and Firebase Data Processor elements also receive the "data schema" option.

You can see a sample of the "task manager" app using data schema on this editor -> https://bubble.io/page?type=page&name=tasks-with-schema&id=estare-plugin-firestore&tab=tabs-1

That mean you can define a type of "thing" on Bubble's API Connector an use it to map the fields of your Firestore Documents, making the extraction of data from the document fields as easy as selecting a property in a Bubble "thing".

Here is how to do it

  1. Install the Bubble API Connector on your Bubble app

  1. Click on "Add another API"

  1. Click on "Add another call"

  2. Give the API Call the name you want your document type to have (e.g. "task"). Make sure the "Data type" of the call is "JSON".

  1. Click on the "Manually enter API response" option

  1. Get a sample, in JSON, of the Firestore document you want to create a schema to, and paste it on the popup window.

You can you our "schema builder" to turn the raw JSON string returned by Firestore Data Single elements into a "data schema" you can you on the API Connector.

Hit "Save" and choose how you'd like each field to be treated from Bubble. For instance, as a text, number or date.

  1. Now, on one of the supported element, you can define the "data schema" as "task"

  1. Then, you can access the document's fields from the "data (w/ schema)" state.

Last updated