Forum Academy Marketplace Showcase Pricing Features

Duplicate entries in a list

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.

Sorry - I should have added a link to my app. Here it is:

The way it works is that a player picks their name from a dropdown, then adds their shots made and shots taken, and that data is added to that player.

So by having makes added to a player, I’m struggling to find a way to get duplicate numbers to work.

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.

Aha! Then when I add the days to the player, do I just use the :last item?


This topic was automatically closed after 70 days. New replies are no longer allowed.