# Register time that a checkbox was checked

**URL:** <https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734>\
**Category:** Need help\
**Created:** [February 7, 2023, 3:48pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734 "2023-02-07T15:48:32Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![luiz.o.rodrigues](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@luiz.o.rodrigues](https://forum.bubble.io/u/luiz.o.rodrigues)\
**Post date:** [February 7, 2023, 3:48pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/1 "2023-02-07T15:48:32Z")

</div>

Hello,

I’m currently developing an app that I need to know when a customer selected a certain checkbox. At the end I’d like to know every day: “current date/time - date/time the checkbox was selected”.

Does anybody here can help me with that question? Thanks a lot!

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [February 7, 2023, 3:53pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/2 "2023-02-07T15:53:15Z")

</div>

Hi there, @luiz.o.rodrigues… assuming a customer is a user in your app. what you described could be as simple as having a field (date) on the `User` data type to store the date when the checkbox was checked (which you could do by using the _An input’s value is changed_ workflow event). With the date stored in that field, you could easily show how many days have passed since the checkbox was checked by subtracting the date in the field from the current date/time and formatting the result as days.

Hope this helps.

Best…  
Mike

---

<div class="post-metadata">

**Author:** ![darren.james7518](https://avatars.discourse-cdn.com/v4/letter/d/a3d4f5/32.png) [@darren.james7518](https://forum.bubble.io/u/darren.james7518)\
**Post date:** [February 7, 2023, 4:32pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/3 "2023-02-07T16:32:43Z")

</div>

Yep, @mikeloc suggestion is spot on, beat me to it! 👍

---

<div class="post-metadata">

**Author:** ![luiz.o.rodrigues](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@luiz.o.rodrigues](https://forum.bubble.io/u/luiz.o.rodrigues)\
**Post date:** [February 7, 2023, 4:49pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/4 "2023-02-07T16:49:17Z")

</div>

> [@mikeloc](#):
>
> Hi there, @luiz.o.rodrigues… assuming a customer is a user in your app. what you described could be as simple as having a field (date) on the `User` data type to store the date when the checkbox was checked (which you could do by using the _An input’s value is changed_ workflow event). With the date stored in that field, you could easily show how many days have passed since the checkbox was checked by subtracting the date in the field from the current date/time and formatting the result as days.

Thanks for the quickly reply, @mikeloc

Just to make sure I understand. I have a repeating group with 11 options to selct. When the user select(check) onde of these I have to register (make changes to thing) the date in a data type. So in this case i should have 11 columns with date to separate each one? is that right?

Because sometimes the user selects an item in a different day and it is important to track each one separadely…

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [February 7, 2023, 4:52pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/5 "2023-02-07T16:52:31Z")

</div>

What is the repeating group displaying? Is it data from a data type that is associated with the current user? If so, can you just make changes to the specific thing for which the checkbox is being checked and store the date on that thing?

---

<div class="post-metadata">

**Author:** ![luiz.o.rodrigues](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@luiz.o.rodrigues](https://forum.bubble.io/u/luiz.o.rodrigues)\
**Post date:** [February 7, 2023, 4:55pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/6 "2023-02-07T16:55:01Z")

</div>

> [@mikeloc](#):
>
> date on that thing

Exactly, I’m already making changes to a thing when I select an item of this RG.

So I should add 12 new columns in that type to track the time of each item I’ve selected?

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/b/5/b52e64b8a6c447fad849e7af49fbe349048760e7.png)

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [February 7, 2023, 4:58pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/7 "2023-02-07T16:58:01Z")

</div>

I’m probably missing something here, but wouldn’t you only need one date field? If there are 12 things that are being displayed in the repeating group, then you would make changes to 1 of those 12 things, and you could store the date in a date field on that thing.

---

<div class="post-metadata">

**Author:** ![luiz.o.rodrigues](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@luiz.o.rodrigues](https://forum.bubble.io/u/luiz.o.rodrigues)\
**Post date:** [February 7, 2023, 5:01pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/8 "2023-02-07T17:01:32Z")

</div>

Sorry to not make it clear.

eg.

- The user can select the item CVC today. 02/07. I have to track this date inpendently to know how many days of CVC I have.
- The user can select the item VM tomorrow. 02/08. I have to track this date inpendently to know how many days of VM I have.  
And so on…  
Thats why I thought that I should have the columns for each item.

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [February 7, 2023, 5:02pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/9 "2023-02-07T17:02:32Z")

</div>

You can probably just go with 12 date fields, but out of curiosity, what is the data source of the repeating group?

---

<div class="post-metadata">

**Author:** ![luiz.o.rodrigues](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@luiz.o.rodrigues](https://forum.bubble.io/u/luiz.o.rodrigues)\
**Post date:** [February 7, 2023, 5:03pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/10 "2023-02-07T17:03:29Z")

</div>

Some hospitalar devices 😅

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [February 7, 2023, 5:05pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/11 "2023-02-07T17:05:27Z")

</div>

I’m not sure what that means, but if they aren’t things in a data type that are associated with the current user, then you can either create a new custom data type to store the dates or just put 12 date fields on the `User` data type (or on whatever data type makes sense) and store the dates there.

---

<div class="post-metadata">

**Author:** ![luiz.o.rodrigues](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@luiz.o.rodrigues](https://forum.bubble.io/u/luiz.o.rodrigues)\
**Post date:** [February 7, 2023, 5:10pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/12 "2023-02-07T17:10:28Z")

</div>

Thanks, man.

I think in this case I have to track them individually.  
The source is a data Type (Dispositivos) . WHen I select I make changes to another data type (Paciente) and register the name of the current cell’s Dispositivos from the RG to the Paciente’s thing.

What I’ve to control is how many day each Paciente is using each Dispositivo.

---

<div class="post-metadata">

**Author:** ![luiz.o.rodrigues](https://avatars.discourse-cdn.com/v4/letter/l/50afbb/32.png) [@luiz.o.rodrigues](https://forum.bubble.io/u/luiz.o.rodrigues)\
**Post date:** [February 7, 2023, 6:37pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/13 "2023-02-07T18:37:22Z")

</div>

@mikeloc

When I tried to do everything we talked here in my app, I could not make it.

I’ll try to show you  
This is the source of the RG:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/c/d/cd6e93c4df85db3f10a33fdc9fbb8a81501de06d.png)

Here is where I’m saving (making changes to thing) the name of selected “Dispositivo”

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/b/8/b80bec35dd89fd53b93bb28c9e8a55ac5810b749.png)

This is the Workflow to save the name:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/a/3/a390348f54abc849183e231e296f154a9aa49c7c.png)  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/8/d8039b2ba459670b93208f16f6c45d48a802020e.png)

Look that this field is a “List of Dispositovoses”, so when I select more than one “dispositivo” in the RG, I cannot separate the time of selection of each one individually even creating 12 new columns in the database.

Sorry again for the bad explanation and bad english here…Hope You can help me to find a solution

---

<div class="post-metadata">

**Author:** ![mikeloc](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mikeloc/32/93001_2.png) [@mikeloc](https://forum.bubble.io/u/mikeloc)\
**Post date:** [February 7, 2023, 6:43pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/14 "2023-02-07T18:43:22Z")

</div>

I’m really not sure that I understand what you are trying to do, but I’m guessing I wouldn’t save the selected items in a list. I would likely use a custom data type and create a new thing in that data type when an item is selected, and that will give you a thing that is associated with the current user and that has a created date so you know when the item was selected. If the same item is deselected, delete the associated thing in the custom data type.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [April 18, 2023, 3:49pm UTC](https://forum.bubble.io/t/register-time-that-a-checkbox-was-checked/245734/15 "2023-04-18T15:49:12Z")

</div>

Closed on April 18, 2023, 3:49pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
