Building a Select's Options from Retrieved Data
Retrieving a List of Product Categories Through a Dataflow and Displaying Them as Options in a Select
Retrieve Values from a Dataflow
- Click [Create] in [Dataflows] and change the dataflow name to
listCategories
. - Select
Onboarding Firebase
as the data source. - Choose [List documents] in [Action] and enter
categories
in [Collection]. - Click [Run].
Dynamically Display Values from Dataflow in Select
- Place a [Select].
- Open the editor for the [Select] and enter
{{ listCategories.data.map(d => d.id) }}
in [Values]. - Enter
{{ listCategories.data.map(d => d.name) }}
in [Labels]. - Enter
Select a Category
in [Label]. - Verify that it operates correctly in the preview screen.