It’s basically a tracker for a book lending library to track who’s borrowing what book and when it’s due back. I have three data types…Borrowers, Books and Transactions.
I’m trying to learn how to pull data from across all three data types so I created a Repeating Group on my Transactions page. It shows the Date out and Date Due Back correctly - ie a single date on each line of the repeating group. But it’s returning all Borrowers and All Books on each line of the repeating group.
I set a BorrowerID field as a Primary Field in the Borrowers Data Type.
Then set a TransactionID as a Primary Field in the Transactions Data Type.
Then set BookISBN as a Primary Field in the Books Data type.
This was because I thought there should be a unique identifier in each data type (I don’t know if there should be so please correct me if it’s wrong).
Can anyone tell me what I’m doing wrong and advise me how to correct this?
Many thanks
Your issue is how you use and set your data.
For example, the first column should not be a Search for but a Current cell transaction’s borrowerid’s lastname. But actually, your transaction data doesn’t contain this information. So you must populate it when you create a transaction.
Many thanks for coming back to me on this. I’ll have a play with it when I get time.
Another question though (sorry!) should the database in a Bubble app not be a relational database then? I’m happy if not because the design would be simpler but my understanding is that, in this example, I’d end up entering the Borrower’s name each time they borrowed a book rather than having the database look it up based on a Borrower ID number.
Thank you for your input on my initial question above though.
As @Jici said, your data structure is not set up correctly.
I’m not sure of the best way to set this up. (perhaps searching this forum for similar “tracking” apps would provide some insight).
However, it would seem to me that you need to track if a “transaction” is open (Yes/No field). And the Borrowers would need a field for Transactions (list). This way you can see the current Books a Borrower has out, and the history of books checked out and returned by showing the Borrower’ s list of Transactions constrained by Open=Yes or Open=No.
You’ll need to have Workflows that create a new Transaction, then add the Transaction (result of step 1) to the Borrowers list of Transactions when they check out a book. Then another Workflow to change the Open? field to “No”, and set the date returned when the Book is returned.
Perhaps the Book datatype also needs a field of Transactions (list) so you can look at all the Transactions by Book. This can be done in the same workflow that creates the Transaction.
IDK, other than setting up the data structure is critical, and you should spend a lot of time figuring that out first before building the app.
Thank you so much for your input. I’m finding it tricky to get my head around the data structure and I think I’m overthinking it. I’ll look into each and all of your suggestions.