Managing multi-user lists in Firebase - Analytics results

Last October, and I would like to express my immense gratitude to our colleague Gianluca Franco for his support on this matter, as he dedicated his time to helping us understand the list management method in Firebase.

I ran a test using my data:
Hypermarket: name of the establishment;
Product: name of the product, resulting in:
Tag (test/parlist): Hypermarket/Epa
Value: Rice.

json
{
“PROJECTBUCKET”: {
“Hipermercado”: {
“BH”: {
“-OphceajH2cN7sPPkPqT”: “Arroz”
},
“Epa”: {
“-Ophckux97wyUcH2uRfi”: “Arroz”
},
"Villefort ": {
“-Ophc0b-XqfnJ7eC3OM9”: “Arroz”,
“-OphcAXfyPd_q7azFsfA”: "Feijão "
}
}
}
}

In the app it looked like this:

When I add the value “Rice” to the “Hypermarket/Epa” tag, it deletes it but keeps the “Villefort and BH Hypermarkets”. To delete the others, i.e., hypermarket/product, it is necessary to enter the name of the hypermarket, obtain the list, and then delete.

I did it another way now. In the tag I put:
Hypermarket/Hypermarket Name/Product/Product Name.

Json:
{
“PROJECTBUCKET”: {
“Hipermercado”: {
“BH”: {
“Produto”: {
“-Ophgk4VLTu_JhjgqG-K”: "Açúcar ",
“-Ophgpk2Lb–Q-YJ5rZX”: “Óleo”
}
},
“Villefort”: {
“Produto”: {
“-OphgQHPUy7o6R8TbTMc”: “Arroz”,
“-OphgaGsxqs3kdgE5pga”: “Feijão”,
“-Ophge3EvFxfVQ-xAGRy”: "Açúcar "
}
}
}
}
}

To delete, I’ll first have to type the tag, get the list, and then delete the object from the list.

Now come the questions:

1 - Product prices. Example:
Supermarket: Villerfort
Product:
Rice
Price:
R$ 20.00.

I’d like the product name and its price to appear in the list. Is that possible?

2 - Since the products don’t have fixed prices, how do I edit these prices?

3 - On the quote screen, how do I get these values: Supermarket, Product, and Price?

1 Like

So you want the result this way…

What’s my suggestion is, to store the items like this in RTDB.

A structured data snippet showing a 'SuperMarket' category with an 'Items' subcategory listing 'Rice' with a quantity of 15. (Captioned by AI)

Don’t add the $ sign in the value of the product. Keep the product name as key and the amount as value. Add the $ sign in the UI section not at the base RTDB.

I remembered that time​:blush::blush::blush:

He’s deserve it, from myself too, this guy he’s very helpful without any expectations when helping anyone. I/am still learning many useful things from our dearly Ray.

Yes this is definitely possible, but from Ray I have leaned something that I think it’s a better option than Firebase database, which is supabase. I was hearing people talking about it, so Ray helped me out set the database to my current project, I found it very useful, it’s support Edge functions, SQL typescript, indexing, tables connection, RLS security, even authentication too, millions API calls, 1 GB free storage (accessed in free plan too, which makes it more than Firebase) the only limitations I hate is project paused after 7 days of inactive. I have set a lot of Edge functions, that helps me protecting some sensitive data, eg some of my API keys, eg I can call initialize payments via Edge functions (off topic)

I think I should asked you, is the project fully developed or still in development?

Also the response of Vega_Star is also powerful.

2 Likes

Hi dear, I hope everything is fine.

To give everyone a reference, this is the guide this project is based on:

As specified, the list items are created using a RecyclerList with a schema,

and to include the price you simply need to modify the schema.
In the project there is a screen called schemaFBListItem, you can modify it by adding the elements you need and then regenerate the schema with the SchemaGenerator

Could you explain better what you mean? What exactly would you like to achieve?


Many thanks dear :heart_hands:


Edit:

I’ve modified the project to allow you to enter both product name and price.


I updated the schema and made the necessary connections for the RecyclerList.

If you have any doubts, feel free to ask.
FirebaseList4Carlos.aia (134.2 KB)

Have a nice day, dear