# Create a current streak

**URL:** <https://forum.adalo.com/t/create-a-current-streak/8038>\
**Category:** Get Help\
**Created:** [January 16, 2021, 4:33pm UTC](https://forum.adalo.com/t/create-a-current-streak/8038 "2021-01-16T16:33:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nsheetz86](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/nsheetz86/32/2616_2.png) [@nsheetz86](https://forum.adalo.com/u/nsheetz86)\
**Post date:** [January 16, 2021, 4:33pm UTC](https://forum.adalo.com/t/create-a-current-streak/8038/1 "2021-01-16T16:33:02Z")

</div>

Hello! I am creating a daily reading app and want to incentivize people to read in it daily. How can I create a “streak” function that adds up the number of days in a row that a user accesses a specific tab in the app?

---

<div class="post-metadata">

**Author:** ![crmorris2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/crmorris2/32/5681_2.png) [@crmorris2](https://forum.adalo.com/u/crmorris2)\
**Post date:** [January 16, 2021, 5:11pm UTC](https://forum.adalo.com/t/create-a-current-streak/8038/2 "2021-01-16T17:11:23Z")

</div>

This can be achieved by adding a numeric field called ‘counter’ to your users collection and also a ‘last login’ or ‘last tab visit’ date field. Every time a user logs in or clicks a tab, update the ‘last login’ or ‘last tab visit’ with current date/time.

Also add an action on login or tab visit to update the ‘counter’ field with +1 if the current time is equal to or less than 1 day than ‘last login/tab visit’ field. Setup another action on login to set the counter field to 0 if current time is greater than 1 day from last login/tab visit.

Something to bear in mind when working with native apps is people have to manually logout as sessions on apps do not timeout. This might make your idea a lot trickier and would call for a different approach.

Let me know how this works out for you

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [January 26, 2021, 5:11pm UTC](https://forum.adalo.com/t/create-a-current-streak/8038/3 "2021-01-26T17:11:35Z")

</div>

Closed on January 26, 2021, 5:11pm UTC

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