I am creating a subscription app. One of the functions I need it to have is the ability to historically track the “credits” every time a user adds. I was able to do “a part of this function” this successfully as shown on below screenshot :
Now, a credit can be just an additional 1 point, or 2 points, etc. So the credit, as a thing, will be added multiple times. For instance, as a user, I can add 1 credit on my account today. Then add another 1 point, tomorrow.
I realized that Bubble doesn’t add a thing on a list if it is already on there, hence, as ssen on the screenshot above, if I add 1 more credit, the list will only have 1 item on it because it will be read as a duplicate.
This next screenshot shows that I have tried to add 1 credit 3 times but bubble only listed 1 thing and considered the other 2 as duplicated but also shows “something was added 2 more times” as seen on the creation date.
Can someone kindly help me find a way to track credits being added? I was thinking instead of numbers I can just add actual letters so Bubble wouldn’t find entries as duplicates - ie ONE, TWO, THREE. But then that’s going to look really weird.
Your help would be super appreciated! Thanks in advance!
I think your credit ledger needs to be a separate Data Type as opposed to a list of things. Then your credit ledger will represent the relationship between your users and their credits. Then when your users add credits, your workflow will add new records to the ledger, without the restriction you’re currently running into.
So essentially I just need Bubble to accept multiple entries and not count them as duplicates for this specific function so I can keep a record of credits added as my users might want to add 1 credit per day for 5 days, hence the entry titled “1” will be added as an entry multiple times.
Change the email address field to be a field of type user. This will be enable some of the following steps we will do, and is better practice for data structure.
Change the topup and topup2 fields to not be a list. They should be single entry fields.
Now lets fix the workflows:
3. In your workflow where you add a credit to the user, add a completely new record every time. This was my earlier point that the credit field shouldn’t be a list.
User = current user
Credit as applicable
Then to see the added credits for the user, create a repeating group with the datasource “Do a search for credits for this user”.