Support fetching multiple documents via multiple Document References in ListView

Actions & Logic

Hi

I'm currently facing an issue related to ListView and Document References in Firestore.

My current situation:

  • I have a collection ("Owners") that contains an array of Document References linking to another collection ("Properties").

  • I want to display these referenced documents in a ListView using the array of Document References.

However, it seems that FlutterFlow's "Query Document from Reference" cannot directly handle multiple Document References stored in an array. The available methods support only single-document references or string-type fields.

Could you please confirm if this is indeed the current limitation, or if there's an alternative solution I'm overlooking?

Proposed Solution:

Allow ListView’s "Query Collection" to directly query and retrieve documents from an array of Document References, possibly by introducing an option such as "Array Contains Any" specifically for Document References.

Benefits:

  • Cleaner Firestore data structure.

  • Reduced complexity in app logic.

  • Enhanced productivity and easier maintenance.

What have you tried so far?

Since fetching multiple Document References directly in a ListView seems not possible in FlutterFlow's current UI, I'm planning to add a field to the "Properties" collection referencing back to "Owners," and then use "Query Collection" to fetch data based on that field.

While this workaround is acceptable and aligns with my project's current requirements, it introduces additional complexity, as it requires manual and ongoing updates to maintain data consistency. Therefore, I'd ideally prefer to handle this using the original method described above, if it becomes possible in the future.

Did you check FlutterFlow's Documentation for this topic?
Yes
1
2 replies