Document from Reference
This backend query would help you in retrieving information from a document reference. You will require the Document from Reference query if you have passed a document reference to a different page of the app and want to retrieve the actual document information from the reference.
Prerequisites
In order to use this backend query, you should have:
- Completed all the steps of Firebase Setup for your project.
- At least one Firestore Collection is defined in your project.
Defining the Query
Go to your project page on FlutterFlow and follow the steps below to define a Document from Reference backend query:
- Select the widget (or page) on which to apply the query.
- Select Backend Query from the Properties Panel (the right menu).
- Select the Query Type as Document from Reference.
- Choose a Collection from the dropdown to which the document reference belongs.
- Select the Source as the record reference name.
Using Query Data
The document information retrieved from the backend query can now be set on the widgets present inside. Follow the steps below:
- Select the widget (eg,
Text
) on which you want to set the record data. - From the Properties Panel, select Set from Variable.
- Choose the Source as the record variable.
- Under Available Options, select a field name.
- You can also specify a Default Value (it is used if the record field is empty).
- Click Save.
You can follow similar steps for using the record data on the other widgets as well.