๐Ÿ’พ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.

circle-info

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-1arrow-up-right

That mean you can define a type of "thing" on Bubble's API Connectorarrow-up-right 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.

circle-info

You can you our "schema builderarrow-up-right" 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.

circle-exclamation
  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