Price comparison between documents

Actions & Logic

I have a collection called 'respostasFornecedores' (supplierResponses). Within the documents in this collection, there is a field in list format called 'precos' (prices). Inside this 'precos' field, each index is composed of the following structure: a 'produto' (product) field (string) and a 'preco' (price) field (double).

Now, I need to create a new list in my app that displays only the products with the lowest price found. For example: if the product 'beans' is listed at 12.00 in one document, 15.00 in another, and 18.00 in yet another, only the beans priced at 12.00 should be included in the list. This should apply similarly to all other items.
Can someone help?

What have you tried so far?

I have already tried the following approach:

1. Backend Query 'respostasCotacoes' Documents >
2. Generating Children from Variable >
3. Map List Items >
4. Item in List >
5. Get Document Property >
6. prices >
7. Item at Index >
8. First (Here I can only fetch the first or the last one; but I would like to fetch all of them)
9. Sort List Items > SortKey > prices
10. Sort Order > Ascending

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