# Counting in the database

**URL:** <https://forum.bubble.io/t/counting-in-the-database/219237>\
**Category:** Need help\
**Created:** [August 9, 2022, 6:30pm UTC](https://forum.bubble.io/t/counting-in-the-database/219237 "2022-08-09T18:30:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wetzeltechlab](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wetzeltechlab](https://forum.bubble.io/u/wetzeltechlab)\
**Post date:** [August 9, 2022, 6:30pm UTC](https://forum.bubble.io/t/counting-in-the-database/219237/1 "2022-08-09T18:30:51Z")

</div>

So I was wondering if there was a way to count in the database(so that the first entry is 2, and the second entry is 2) Please Help

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/7/6/76071ef634161df183322c21c1fa5e4c518dc9c6.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:** [August 9, 2022, 7:32pm UTC](https://forum.bubble.io/t/counting-in-the-database/219237/2 "2022-08-09T19:32:25Z")

</div>

Hi there, @wetzeltechlab… can I assume you meant the first entry would be 1, the second entry would be 2, and so on? If so, a couple of ways you can go are when a new thing is created, set the field to a search for the last thing’s number plus 1 or set it to a count of the number of things in the data type plus 1. True, if lots of things get created around the same time, that could cause an issue with the numbering, but without knowing more about your exact use case, that’s what comes to mind.

Hope this helps.

Best…  
Mike

---

<div class="post-metadata">

**Author:** ![flowtron](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/flowtron/32/117912_2.png) [@flowtron](https://forum.bubble.io/u/flowtron)\
**Post date:** [August 9, 2022, 7:55pm UTC](https://forum.bubble.io/t/counting-in-the-database/219237/3 "2022-08-09T19:55:22Z")

</div>

If you ARE in fact trying to get a Thing count, where you want both to be 2 because there are 2 Things, I would highly recommend using a separate Data Type for this. I have a “Rollup” Data Type for Poll Votes, as an example, so that I can store the total number of votes for a Thing without storing it on every Vote. With the example as given, you would need to update every single record every time a Thing gets updated and depending on how many you expect, that’s madness haha

---

<div class="post-metadata">

**Author:** ![wetzeltechlab](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wetzeltechlab](https://forum.bubble.io/u/wetzeltechlab)\
**Post date:** [August 10, 2022, 11:25am UTC](https://forum.bubble.io/t/counting-in-the-database/219237/4 "2022-08-10T11:25:36Z")

</div>

I figured it out, I just needed to put the amount of people who have pressed a button into a text with the command “search for signups:count” but thank you for the helpful replies!!

---

<div class="post-metadata">

**Author:** ![iimarzdesignz](https://avatars.discourse-cdn.com/v4/letter/i/58956e/32.png) [@iimarzdesignz](https://forum.bubble.io/u/iimarzdesignz)\
**Post date:** [August 10, 2022, 6:05pm UTC](https://forum.bubble.io/t/counting-in-the-database/219237/5 "2022-08-10T18:05:29Z")

</div>

can i ask what you put in your do A search for ?

---

<div class="post-metadata">

**Author:** ![wetzeltechlab](https://avatars.discourse-cdn.com/v4/letter/w/e79b87/32.png) [@wetzeltechlab](https://forum.bubble.io/u/wetzeltechlab)\
**Post date:** [August 10, 2022, 6:22pm UTC](https://forum.bubble.io/t/counting-in-the-database/219237/6 "2022-08-10T18:22:31Z")

</div>

Sure, I put "name inputs = Current User’s real name  
So whoever pressed the button, their name will be on the sign up

---

<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:** [October 18, 2022, 6:31pm UTC](https://forum.bubble.io/t/counting-in-the-database/219237/7 "2022-10-18T18:31:14Z")

</div>

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