# Prevent duplicate dates

**URL:** <https://community.glideapps.com/t/prevent-duplicate-dates/85064>\
**Category:** Ask for Help\
**Created:** [October 24, 2025, 10:46am UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064 "2025-10-24T10:46:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 10:46am UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/1 "2025-10-24T10:46:57Z")

</div>

Trying to verify my understanding here.

I have a table with a date and a description. The date is selected via the date picker on a custom form that writes to a temporary table to check if the date has already been used.

My problem is that, I have created a relationship between the date in the main table and the temp table but nothing shows when the dates are the same. Both fields are set to date only (short format). If the time somehow getting checked (even although I can’t see it) is there an in-built function just to record dates without the time?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 24, 2025, 11:00am UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/2 "2025-10-24T11:00:17Z")

</div>

> [@jejones](#):
>
> Is the time somehow getting checked (even although I can’t see it) which is why I’m getting no matches?

Yes, almost certainly that is the case.  
When you set “Date only” on a date/time column, that only affects what is displayed. The full date/time value is still stored under the hood, and used in any computed columns.

What you can do is use a Math column to convert both dates to integers, and use the Math columns in your relation. Use the following:

```auto
Year(Date)*10^4
+ Month(Date)*10^2
+ Day(Date)

```

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 11:17am UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/3 "2025-10-24T11:17:25Z")

</div>

Thank you. Would be nice if a function already existed.

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 12:16pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/4 "2025-10-24T12:16:39Z")

</div>

> [@Darren\_Murphy](#):
>
> ```auto
> Year(Date)*10^4
> + Month(Date)*10^2
> + Day(Date)
> 
> ```

Sorry to be a pain. I have created the math column and this now working fine but I can’t get my head around what I am trying to achieve now.

I have 2 tables. one with dates and other fields. The other checks if the date has already been used.

In my custom form, I have bound this to the date checker table and added the date picker. When I click submit, it adds a new row to the date checker table and the relation field advises if this date has been used.

I don’t want the submit button to show if the date has been used and I’m not sure how I accomplish that when I need to write the data to the table first to check.

I also want to write the data back to the main table if the date hasn’t been used but I can’t see how I can do that in the custom form when it’s bound to a different table.

I hope I’m making sense here.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 24, 2025, 12:21pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/5 "2025-10-24T12:21:58Z")

</div>

You said that you are using a Custom Form. So that means you are writing the selected date to a User Specific column, and then using that with an Add Row action, right?

Assuming that’s the case, the relation should be formed (or not) before the user clicks submit.

If you’re actually using a native form, then what you can do is target the date picker at a column in your User Profile row, and build the relation from there. Then use the selected date as a user profile value with the form.

If you’re not sure what type of form you have, show me a screen shot.

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 12:34pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/6 "2025-10-24T12:34:41Z")

</div>

I originally had it as a in-line form. I then changed it to a custom form and yes, I am using the add row action. I don’t understand how the relation can be formed before the user clicks as the submit button is what’s used to write the data to check in the first place.

I am not using user profiles.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [October 24, 2025, 12:41pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/7 "2025-10-24T12:41:16Z")

</div>

> [@jejones](#):
>
> I don’t understand how the relation can be formed before the user clicks

Because that’s how a Custom Form works. Inputs are written to User Specific columns so that they can be used (amongst other things) for pre submit validation. I’m guessing that you’re not really using a Custom Form. And if that’s the case your only option is to switch to one - because you don’t have user profiles. Again, if you show me a screenshot of your form layout I’ll immediately be able to tell.

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 1:27pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/8 "2025-10-24T13:27:35Z")

</div>

Ignore the top button. That was the in-line form. I added another button with the flow of open new screen and then added the fields.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/1/d1a8846e05350e21747569905a47fcbe5129bf40.png)

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 24, 2025, 2:01pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/9 "2025-10-24T14:01:28Z")

</div>

As soon as you select a date, itis written to the table that is the source of that screen, correct? That is where you should have your relation. If the relation is empty, show the submit button, else it will be hidden.

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 2:15pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/10 "2025-10-24T14:15:45Z")

</div>

No, I have to press submit before the data is written to the table.

EDIT: okay, it looks as though it is writing the date but to the wrong table. I’m getting confused by what’s supposed to happen.

What I have is 2 tables. one with dates, comments, players, rollup scores etc… (call it table1)

I have another table (table2) which just has dates and relationship columns to determine if the date already exists in table1

The tab is linked to table 1 but I believe the form should be linked to table 2 so that when a date is entered, I can check if it exists. What seems to be happening is, when the date is selected, it’s adding it to table 1 so it’s not checking if it exists. I guess I can change the source to sort that but what I don’t know is how do I then write the data back to table 1 if it’s determined that the date chosen has not been used before?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 24, 2025, 2:39pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/11 "2025-10-24T14:39:46Z")

</div>

A native form stores entry data in temporary memory. A custom form is not a native form. It is a detail screen connected to an existing row of data. Your custom form (detail screen) instantly stores your entry values directly in the table row that the screen is attached to as you type. The Add Row action attached to your button takes those values from that table and writes them to a new row in a destination table. With a custom form, you are working with live data as opposed to a native form which is not attached to any live data.

I prefer having a separate table that only serves the purpose of driving your custom form. It sounds like you are trying to duplicate the all dates between two tables. You don’t need that. Table 2 should be a single row helper table with user specific columns to store your entry values for the custom form. Your custom form should be attached to Table 2. Table 2 should then have a relation linking the entered date to existing dates in Table 1. If the relation is empty and the entered date is not empty, then show the Submit button. (You should never have more than one row in Table 2)

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 3:08pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/12 "2025-10-24T15:08:30Z")

</div>

I’ve got you (I think) 😄

I’m not trying to duplicate the fields. the second table is just a holding table to verify the date hasn’t been used. Once it’s populated table1, the data in table 2 will be deleted. I think I’m almost there, I’ve just go the data sourced the wrong way round.

The custom form only seems to allow data to go into table 1 rather than table 2 (the one used for checking). I’m not sure how I point the custom form to an alternative data source.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 24, 2025, 3:51pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/13 "2025-10-24T15:51:07Z")

</div>

Change the action that opens the form. I assume you have it set to ‘Show New Screen’ → ‘This Item’, but instead change it to ‘Show Detail Screen’ → ‘Table 2’. You can can still use ‘Show New Screen’, but it probably doesn’t really matter. ‘Show Detail Screen’ locks the screen layout to the table which is useful if you need to reuse the same form elsewhere in your app. ‘Show New Screen’ gives you a new screen layout for each instance that you use it, even with the same table.

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 4:50pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/14 "2025-10-24T16:50:30Z")

</div>

Ok and once I’ve done that and confirmed it’s okay to submit, do I need another action to write the data back to table 1?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 24, 2025, 4:55pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/15 "2025-10-24T16:55:56Z")

</div>

Isn’t that what the submit button is for? To submit your form data to Table 1? The date should already be in Table 2 the moment you selected a date from the date picker. The relation should have checked for any matches in Table1 at the same time. As a result, the Submit button should only be visible if the relation is empty.

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 5:32pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/16 "2025-10-24T17:32:20Z")

</div>

I think I’m SLOWLY understanding what you mean.

I’m finding it slightly difficult to wrap my head around it

I can do this in SQL but glide is a different beast

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 24, 2025, 5:36pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/17 "2025-10-24T17:36:47Z")

</div>

If you share some screenshots of your progress, it might be easier to see where you are stuck. Mostly I’d be interested in seeing the the configuration for your custom form screen. It the form screen attached to Table 2? What column is the date picker in that form writing to? How is the relation configured in Table 2? What does your visibility condition look like for your Submit button? How is the action configured for the Submit button?

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 24, 2025, 5:54pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/20 "2025-10-24T17:54:20Z")

</div>

I’ll send some stuff over tomorrow if that okay?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [October 24, 2025, 5:59pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/21 "2025-10-24T17:59:11Z")

</div>

Not a problem.

---

<div class="post-metadata">

**Author:** ![jejones](https://avatars.discourse-cdn.com/v4/letter/j/e274bd/32.png) [@jejones](https://community.glideapps.com/u/jejones)\
**Post date:** [October 27, 2025, 3:16pm UTC](https://community.glideapps.com/t/prevent-duplicate-dates/85064/22 "2025-10-27T15:16:07Z")

</div>

Hi Jeff, I have parked the date thing for now as I’m trying to sort something else out.

I have a table of players which I have linked to a choice component. Scores can be entered for these players based on a date which has been selected. What I am trying to do, when a player has been selected and entered, the choice component should remove that player from the list,

I have created a relation column which shows which players have been selected from a date which I thought I could use to filter the choice field. The problem is I can’t reference a relation column in a choice field. Does that make sense. I have created a template if you want to see what I’m trying to achieve here. If you don’t have time to look but could point me in where I’m going wrong, that would be helpful.

> **[Backup of Longniddry Sweep](https://go.glideapps.com/template/I8rFSr7VVPK2GE9kFQCr-template-published?privateTemplateToken=5jiPBw5B4YFQBMb1rk5V)**
>
> Longniddry Sweep Application

[Next page](https://community.glideapps.com/t/prevent-duplicate-dates/85064.md?page=2)
