Firebase Dropdown Processor
Last updated
Last updated
The issue related to this element can also be solved with the new feature.
On Bubble, we might often want to provide data to a dropdown that represents an entire document,
For instante, in our app, suppose we want to choose tasks from a dropdown show the content of the chosem task in a group. Although we could feed the list of tasks to the dropdown, choose a document and use the to get it's contents, the dropdown would show the entire JSON object structure as a text on its options, which is not good user experience.
Intead, we'd want to show a single field for the user to choose from. That's what the Firebase Dropdown Processor does.
The ID Attribute of the dropdown in which you'll display the data.
IMPORTANT! For the processing of the Dropdown to work, it is necessary the dropdown is visible at the same time the Dropdown Processor is. So it is good practice to make this element conditional visibility attached to the dropdown's visibility.
The name or path of the field you want to display on the dropdown.
In our example, we chose to display the "description" field.
Use this to display data in a "complex" way, using "${doc.field}" to indicate each fields you want to display. For instance: "${doc.name} (${doc.email})" will display the name and the email field like "John (john@email.com)".
If both the "field to display" and "complex display" are set, this option will be ignored.
This is an advanced feature, since it uses Javascript to get the fields to show. You might have to deal with situations in which the data you want to display is not a string/text.
For instance, if you try to display the "due_date" field of a task, it will show [object Object], since its a JSON object.
If you're insecure with javascript, we suggest sticking with string/text fields on the Complex Display feature.
The Dropdown Processor element has only one state: the choices to be fed into the dropdown you're processing.
The list of documents you you'll display on the dropdown. (e.g. a list of document data from a element).