Quick Start - Firebase
Assuming a scenario of an e-commerce company, this guide will help you build an internal management interface that allows you to:
- Display a list of product information.
- View detailed information about products.
- Update product information.
- Display a list of users who have purchased products.
Data Integration
We will be using [Onboarding Firebase] which is already connected, so no additional connection setup is required.
For connecting your own data source, please refer to this guide.
Displaying Product Information in a List
- Drag & drop [Text] from the right [Components] onto the canvas.
- In the right [Inspect], enter
Product List
in [Text]. - Change the size to
large
in the right [Inspect] under [Size]. - Drag & drop [Table] from the right [Components] just below the [Text] you placed.
- Click [Create] in [Dataflows].
- Rename the dataflow to
listProducts
. - Choose [Onboarding Firebase] as the data source.
- Select
List documents
in [Action] and typeproducts
in [Collection]. - Click [Run].
- Select the placed table and enter
{{ listProducts.data }}
in [Data] in the [Inspect].
Displaying Detailed Product Information
Display the details of the product data selected in the table dynamically on the right side.
- Drag & drop [Column] to the bottom of the canvas from the right [Components].
- Place the already existing [Table] on the left side of the [Column] and a [Text] on the right.
- Enter
Product Name: {{ table1.selectedRow.data ? table1.selectedRow.data.title : '' }}
in [Text] within the [Inspect]. - With [Text] selected, click the [Duplicate Icon] next to the [Delete Icon].
- Modify the newly duplicated [Text] in the [Inspect] to
Price: {{ table1.selectedRow.data ? table1.selectedRow.data.price : '' }}
.
Updating Product Information
Creating a Form for Product Updates
Update the selected product data information in the table. First, create a dataflow to fetch the category list and reflect it in the select.
- Place a [Modal] on the right of the already placed [Column] and label it
Update Product Information
. - Inside the [Modal], place [Select], [Input], [Text Area], and [Button].
- Click [Create] in [Dataflows].
- Rename the dataflow to
listCategories
. - Choose [Onboarding Firebase] as the data source.
- Select
List documents
in [Action] and inputcategories
in [Collection], then click [Run]. - Click the [Select] inside the [Modal].
- Enter
{{ listCategories.data.map(d => d.name) }}
in [Values] and [Labels]. - Set
{{ table1.selectedRow.data ? table1.selectedRow.data.category : '' }}
as the [Default value].
Creating a Dataflow for Product Updates and Linking it to the Button
- Open the [Modal] and change the labels of [Select], [Input], and [Text Area] to
Category
,Product Name
, andDescription
, respectively. - Click [Create] in [Dataflows] and rename the dataflow to
updateProduct
. - Select
Onboarding Firebase
for [Select resource]. - Input
Update document
in [Action] andproducts
in [Collection]. - Enter
{{ table1.selectedRow.data.meta.id }}
in [Document ID]. - Write the following in [Data]:
{
"id": {{ table1.selectedRow.data.id }},
"category": {{ select1.value }},
"title": {{ input1.value }},
"description": {{ textarea1.value }}
}
- Check [Success events] and select
listProducts
. - Open the [Modal], change the [Button] label to
Update
, and selectupdateProduct
in [Dataflow]. - Enter the following in [Default value] for [Input] and [Text Area]:
{{ table1.selectedRow.data ? table1.selectedRow.data.title : '' }}
{{ table1.selectedRow.data ? table1.selectedRow.data.description : '' }}
- Open [Preview] and confirm that the product information update is working correctly.
Displaying a List of Users Who Purchased Products
- Drag & drop [Text] and [Table] below
column1
. - Open the [Inpsect] for [Text] and enter
Users who purchased {{ table1.selectedRow.data ? table1.selectedRow.data.title : '' }}
in [Text]. - Click [Create] in [Dataflows], change the dataflow name to
listUsers
, and checkRun query automatically when changes occur
. - Select
Onboarding Firebase
in [Action]. - Enter
List documents
for [Action] andusers
for [Collection]. - Click [Add Filter], and enter
productIds
,array-contains
, and{{ table1.selectedRow.data.id }}
in [Key], [Comparison Operator (Symbol)], and [Value] respectively. - Open the [Inpsect] for [table2] and enter
{{ listUsers.data }}
in [Data]. - Open [Preview] and confirm that user information is dynamically displayed.