I have a basketball app where a user can enter how many shots they’ve made and they’ve missed. When they click save, it adds that to a list of makes and a list of shots taken.
The problem I’m running into is let’s say on consecutive days, a player makes 100 shots. It won’t add the 2nd days’ makes because 100 is already in that list. Is there a way around this?
I’m not sure how you have your data structured, but I would imagine you want to have a thing called “day,” and “day” has a field called “makes” on it. That will prevent duplicates, since each day is unique.
I’d consider adding a type of Thing called “Day.” On that thing, make a field called “Date” (type Date) and a field called “Makes” (type number). On the Player, I’d add a field called Days, which is a list of type Day.
When the player enters a number, it creates a “Day,” populates the field called “Date” with the current date, the field called “Makes” with the number they entered, then adds that new Day to the Player’s list of Days.