prevent same date duplicate name insert

Some one please tell me how to prevent same person input his name more than once on the same date?

My app has three item: Date/time, Name, Item

For the Name I want to add a condition(valid if) to prevent people to input his name twice on the same day.

Thank you

Please create a virtual column or real column (if the user updates date time and name through a form) called say [NamenDate] with an expression something like

CONCATENATE( [Date/Time], “-”,[Name])

Then, in the valid_if of the [Name] or [Date/Time] column, you can have an expression , something like

ISBLANK(
FILTER(
“Table Name”,
([_THISROW].[NamenDate] = [NamenDate])
)

  • LIST([_THISROW])
    )

Please replace 'Table Name" with the actual table name you have.

The technique to avoid duplicates is mentioned in the article below in the last section.

List expressions - AppSheet Help

2 Likes

Thank you very much!!

1 Like

@Suvrutt_Gurjar sorry but I have another question now. the person who ordered lunch at 7am for today may want to order again at 8am for another day:s lunch, so the same Name may appear many times, if I use FILTER, the App will not allow the same name apear again right?

Could you elaborate what type of filter you are referring to and for what purpose?

1 Like

Hi @Suvrutt_Gurjar , I want to make my App as simple as possible , so I thought out a way to make it like this:

â‘ App top(edited):

③spreadsheet(edited) :

③-EnumList:

From the 2nd photo you can see if I input exactly the same data like cell D2 the App will stop me says it is duplicated, but if I just input 2023/01/21 or 2023/01/21,2023/01/25 the App still accepted it as new order. Is there a way to solve this problem?