Updating a document with a DocumentID determined by a selection from a dropdown

Resolved

Hi everyone!

I am currently in the process of creating an application whereby a user who is part of a sports team or club can create an event (perhaps a training session on a specific day and time or a match). Currently the user can enter in the title, description, date and cost however because the user can be part of multiple teams they can select the specific team from a dropdown. The dropdown takes the names from the teams the user is part of and displays them correctly however when I call a backend query I would like to take the teamName and update the event collection with the teamName's corresponding documentID.

Here you can see my database schema for the event, user and team collections.

In this photo you can see my backend query to create a new document in the events collection easily creates the fields for title, description, cost and date

This is my WidgetTree for the page.

And here is where I try to add the selection form the dropdown to the team field in the schema- Is there a way I can get the teamName, then query the team collection for its corresponding documentID and then add this to the event collection?

I believe this may be a trivial question but I cannot seem to wrap my head around it having only started flutter flow so recently. If you also have any recommendations for my schemas it would be greatly appreciated!

Kind regards, Rory

3
10 replies