I’m working on kind of online shopping app for which i need to show Order History
Currently I’m using 2 different Fb Database components & 2 Different database (in Firebase Console)
Both Database save the same Details but with the different Pocket/Tag Name ex. Fb.1 Username/orderData & Fb.2 Date/orderData
when user Click on [Order History] button it will only get the Fb.1 Username/order Data and show it in list view (i do get some errors here but i think it’ll get solved in near future)
And i can see the order History with date in Fb.2 Date/orderData inside Fb Console
Here’s where i need your help!
Is there anyway to store all users order history data in only 1 Database? And show it in list view according to the username? And also i can see the new orders according to the date?
(If i use Fb.1 Username/orderData as a single database then I’ve to check every user to get their latest order, atleast in my knowledge!)
P.S. i have used airtable to store data but it is limited to only 1200 records & i tried to use Google Sheet but couldn’t properly understand scripts and all
I don’t know if it will help you.
What you’re trying to do is what relational databases are made of.
1-Table Customers
2-Table Orders
3-Table Ordered Items
Table And with an SQL command joining the 3 tables, you filter all purchases from 1 customer and by initial and final period with the “where” and “and” clause.
@knkiranjoshi no need to connect firebade with Google sheet… The moment you store the value in firebase, same time you store the user details in googlesheet
Bucket : 24-02-2021 (date)
Tag : 0000000000(mobile)
So Every time i click on [Order History] instead of showing all orders it only shows one order!
So to solve this problem i came up with idea of adding +1 behind the Mobile Number
Ex. Bucket: 24-02-2021/000000000
Tag : 0000000000+1
It works when i manually enter it!
So the problem is I’m unable to do it automatically
I mean, when user order first time it should store data as tag 0000000001 and same user order for second time it should Store data as tag 0000000001+1= 0000000002
I have tried with initialize global but don’t know how to do it!
If he order first time , count the order and store in the firebase as a “Order1:Mobile”, second time order mean tell firebase to store “Order2:Watch” like that…
First order save it as a tag 00001 in fb and tinyDB
Second time while he order call tinyDB to read the existing tag, if it finds then upon ordering save it as tag 00002(use maths block in tag to sum it. likewise set up rule