# Automatically create due date

**URL:** <https://community.glideapps.com/t/automatically-create-due-date/72004>\
**Category:** Ask for Help\
**Created:** [March 25, 2024, 1:26am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004 "2024-03-25T01:26:10Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 1:26am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/1 "2024-03-25T01:26:10Z")

</div>

So I’m creating a debt app, and I have a list of debts and then I want to have a list of due dates to display on a calendar but for the life of me I can’t figure this out. What i want is when a user creates a new debt is has a due date I want to take that date and add say 12 rows to the due dates table but I can’t figure out on the add row action how to make the date column do that.

---

<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:** [March 25, 2024, 1:28am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/2 "2024-03-25T01:28:45Z")

</div>

> [@despawned](#):
>
> What i want is when a user creates a new debt is has a due date I want to take that date and add say 12 rows to the due dates table

Why do you need to add 12 rows?

---

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 1:36am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/3 "2024-03-25T01:36:46Z")

</div>

For each month, a debt has due dates per month like for credit cards, personal loans, etc

---

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 1:37am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/4 "2024-03-25T01:37:16Z")

</div>

This is to display on a calendar, and to eventually be able to send out email alerts etc.

---

<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:** [March 25, 2024, 2:12am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/5 "2024-03-25T02:12:43Z")

</div>

Okay, well if it’s always going to be the same number of rows (eg. 12), then you could use a custom action with 12 Add Row steps. Although you’d need to calculate the dates first. That’s possible, but a little tricky. If it’s a variable number of rows, then you would have to use the Glide API.

---

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 2:27am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/6 "2024-03-25T02:27:10Z")

</div>

Yeah for now itll always be 12 rows, What do you mean by calculate the dates first?

---

<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:** [March 25, 2024, 2:30am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/7 "2024-03-25T02:30:08Z")

</div>

Presumably each row should have a different due date value, increasing by one month for each row?

---

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 2:30am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/8 "2024-03-25T02:30:22Z")

</div>

Yes exactly what I want!

---

<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:** [March 25, 2024, 2:32am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/9 "2024-03-25T02:32:47Z")

</div>

Right, so you’ll need to pre-calcuate those 12 dates, so they can be used in the Add Row actions.  
The below thread contains some formulas that will help with that:

> [@date Guide: Mastering Dates & Times](https://community.glideapps.com/t/guide-mastering-dates-times/70381):
>
> The Date & Time column contains both a date and time value within one single value. Dates and times can therefore be tricky to understand and to work with. It helps to keep things simple to stay out of trouble. Here are a few tips: Writing dates Avoid writing dates manually. Use a picker instead. If done via import, be weary of the format of the date column in the source. Relations Anytime you create a relation with a date, convert the date to either a string (template column) or a number (…

---

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 2:35am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/10 "2024-03-25T02:35:15Z")

</div>

so in the add row in the due date I would put one of those formulas?

---

<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:** [March 25, 2024, 2:42am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/11 "2024-03-25T02:42:36Z")

</div>

No, that won’t work.  
You would need to calculate each of the 12 dates first, and then use each of the 12 calculated dates in a separate add row action.

---

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 2:44am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/12 "2024-03-25T02:44:55Z")

</div>

Not sure what you mean by calculate each of the dates first?

---

<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:** [March 25, 2024, 2:48am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/13 "2024-03-25T02:48:25Z")

</div>

Create 12 math columns. Each one adds an incrementing number of months to the provided start date.

At this point I probably should note that I don’t think this is a very good approach. Personally, I wouldn’t be adding all these extra rows. Assuming that you have a Start Date and a duration in months, then that’s pretty much all you need to dynamically calculate any future due dates.

---

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 2:52am UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/14 "2024-03-25T02:52:46Z")

</div>

If I did it the other way you explain how exactly would you recommend adding the rows and getting the right date in each row’s column?

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 25, 2024, 3:01pm UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/15 "2024-03-25T15:01:37Z")

</div>

How would you handle cases where let’s say the start day is 31st of a month, but the next month doesn’t have a 31st?

---

<div class="post-metadata">

**Author:** ![despawned](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/despawned/32/61697_2.png) [@despawned](https://community.glideapps.com/u/despawned)\
**Post date:** [March 25, 2024, 3:13pm UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/16 "2024-03-25T15:13:03Z")

</div>

None of my due dates are on the 31st of the month, so I don’t have that issue. I did figure out how to get this to work though! if you need help let me know.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 25, 2024, 11:33pm UTC](https://community.glideapps.com/t/automatically-create-due-date/72004/17 "2024-03-25T23:33:37Z")

</div>

Thanks, was just trying to help you alongside Darren.

You should also consider the cases of the shortened February, in case your due dates falls on 29th or 30th of other months.
