# Code Help: Filling dates from Checkboxes

**URL:** <https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074>\
**Category:** Ask the Community\
**Created:** [March 6, 2024, 3:54pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074 "2024-03-06T15:54:58Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amber\_Lee-Adadevoh](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/amber_lee-adadevoh/32/41098_2.png) [@Amber\_Lee-Adadevoh](https://connect.superhuman.com/u/Amber_Lee-Adadevoh)\
**Post date:** [March 6, 2024, 3:54pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074/1 "2024-03-06T15:54:58Z")

</div>

Hey ya’ll, I have a doc where I’m checking off daily goals and I want, when I check the task off for it to fill in today’s date as the day the task was completed. But, I know nothing about formatting code, so I can’t get the formula right. Basically I’m trying to go : If my checkbox row is checked, my date row will enter today’s date. Can anybody help me write that out? A saw a similar post, but couldn’t access the actual code.

---

<div class="post-metadata">

**Author:** ![Troy\_Larson](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/troy_larson/32/29176_2.png) [@Troy\_Larson](https://connect.superhuman.com/u/Troy_Larson)\
**Post date:** [March 6, 2024, 4:05pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074/2 "2024-03-06T16:05:24Z")

</div>

I created a GIF walkthrough for you.

Automation is a good approach here, because you ONLY want the date updated if and when the checkbox is actually selected.

![CleanShot 2024-03-06 at 11.02.15](https://global.discourse-cdn.com/coda1/original/3X/f/e/fe858c7d54b2f4fca02b865342d6428c9d6761ac.gif)

---

<div class="post-metadata">

**Author:** ![Jannis](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jannis/32/34283_2.png) [@Jannis](https://connect.superhuman.com/u/Jannis)\
**Post date:** [March 6, 2024, 4:09pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074/3 "2024-03-06T16:09:08Z")

</div>

Hi @Amber_Lee-Adadevoh and welcome to the Coda Community!

There are many ways you can accomplish that.  
I would suggest you to use a button. With a button, you can run actions such as modifying a row.

I just created a doc for you for better understanding. Please check it out and let me know if this solves your problem and if you have any more questions.

> **[https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074 · ...](https://coda.io/@jannis/coda-community/https-community-coda-io-t-code-help-filling-dates-from-checkboxe-20)**

Sincerely  
Jannis

---

<div class="post-metadata">

**Author:** ![Troy\_Larson](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/troy_larson/32/29176_2.png) [@Troy\_Larson](https://connect.superhuman.com/u/Troy_Larson)\
**Post date:** [March 6, 2024, 4:10pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074/4 "2024-03-06T16:10:47Z")

</div>

@Jannis I like your solution better. It’s simpler and immediate.

---

<div class="post-metadata">

**Author:** ![Jannis](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jannis/32/34283_2.png) [@Jannis](https://connect.superhuman.com/u/Jannis)\
**Post date:** [March 6, 2024, 4:12pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074/5 "2024-03-06T16:12:30Z")

</div>

I just saw @Troy_Larson already gave you an answer.

The way he showed is another way to accomplish it.  
As I said:

> [@Jannis](#):
>
> There are many ways you can accomplish that.

Sincerely  
Jannis

---

<div class="post-metadata">

**Author:** ![Amber\_Lee-Adadevoh](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/amber_lee-adadevoh/32/41098_2.png) [@Amber\_Lee-Adadevoh](https://connect.superhuman.com/u/Amber_Lee-Adadevoh)\
**Post date:** [March 6, 2024, 4:48pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074/6 "2024-03-06T16:48:22Z")

</div>

Bless you both. I started with the Troy version bc it was closer to what I already set up. One bug at the end. Instead of converting to a date, it’s just showing the text. I put a screenshot of the problem. I appreciate this so much!

 ![Screen Shot 2024-03-06 at 11.48.00 AM](https://global.discourse-cdn.com/coda1/original/3X/9/4/94c7ef8913a678f12eb0af561e31d362aab6e8a8.png)

---

<div class="post-metadata">

**Author:** ![Jannis](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/jannis/32/34283_2.png) [@Jannis](https://connect.superhuman.com/u/Jannis)\
**Post date:** [March 6, 2024, 5:19pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074/7 "2024-03-06T17:19:50Z")

</div>

Hi @Amber_Lee-Adadevoh,

open your automations and clear the input in the field “Past date”. Then open the formula editor by typing “=”, type Today() and click “Done”.  
Also, make sure the column “Past date” in your table is a date-column. Coda likes to auto change it sometimes.

Please let me know if everything works or if you need any more help.

Sincerely  
Jannis

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [June 4, 2024, 5:20pm UTC](https://connect.superhuman.com/t/code-help-filling-dates-from-checkboxes/47074/8 "2024-06-04T17:20:38Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
