# Entering a default value in a database field based on another field

**URL:** <https://forum.adalo.com/t/entering-a-default-value-in-a-database-field-based-on-another-field/48537>\
**Category:** Database\
**Created:** [July 17, 2024, 8:03am UTC](https://forum.adalo.com/t/entering-a-default-value-in-a-database-field-based-on-another-field/48537 "2024-07-17T08:03:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SalvoInca](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@SalvoInca](https://forum.adalo.com/u/SalvoInca)\
**Post date:** [July 17, 2024, 8:03am UTC](https://forum.adalo.com/t/entering-a-default-value-in-a-database-field-based-on-another-field/48537/1 "2024-07-17T08:03:45Z")

</div>

Hi, I have an ‘arrival date’ field and a ‘departure date’ field. I would like the ‘departure date’ field to be automatically registered with four extra days. For example: If ‘Arrival date’ has the date ‘01/08/2024’ I would like the ‘Departure date’ field to be automatically registered with the value ‘05/08/2024’. Thank you all

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [July 17, 2024, 8:40am UTC](https://forum.adalo.com/t/entering-a-default-value-in-a-database-field-based-on-another-field/48537/2 "2024-07-17T08:40:59Z")

</div>

Welcome to the community @SalvoInca! 🥳

You can just add `arrival date input + 4` in the departure date field.

Here’s a video : [add dates.mp4 - Google Drive](https://drive.google.com/file/d/198uklfqKztjeOjjnsIwH1cQNJgxo2jEF/view?usp=sharing)

---

<div class="post-metadata">

**Author:** ![SalvoInca](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@SalvoInca](https://forum.adalo.com/u/SalvoInca)\
**Post date:** [July 17, 2024, 11:03am UTC](https://forum.adalo.com/t/entering-a-default-value-in-a-database-field-based-on-another-field/48537/3 "2024-07-17T11:03:39Z")

</div>

Thank you for your reply, but I would like that in the creation of the record, as soon as I enter the arrival date, the departure date is automatically created with 4 days added. I don’t want to open a screen to click on a ‘create trip’ button or something like that. I don’t know if I have explained myself well now.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [July 17, 2024, 11:05am UTC](https://forum.adalo.com/t/entering-a-default-value-in-a-database-field-based-on-another-field/48537/4 "2024-07-17T11:05:38Z")

</div>

You mean show before adding with a click of a button?

---

<div class="post-metadata">

**Author:** ![SalvoInca](https://avatars.discourse-cdn.com/v4/letter/s/ac8455/32.png) [@SalvoInca](https://forum.adalo.com/u/SalvoInca)\
**Post date:** [July 17, 2024, 11:15am UTC](https://forum.adalo.com/t/entering-a-default-value-in-a-database-field-based-on-another-field/48537/5 "2024-07-17T11:15:42Z")

</div>

No, when I register an user that arrive for example tomorrow, I’d like that in the “add automatic field departure date” it will be set like tomorrow + 4 days.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [July 17, 2024, 11:25am UTC](https://forum.adalo.com/t/entering-a-default-value-in-a-database-field-based-on-another-field/48537/6 "2024-07-17T11:25:36Z")

</div>

Oh so you have a form? Then check this : [add dates - 2.mp4 - Google Drive](https://drive.google.com/file/d/1tokemRnYl-zvVJPDMxW-zJTp1bcl7gWz/view?usp=sharing)

We have to add a update action because if you add the departure date in the automatic fields section then we can’t access the arrival date.
