# Automatic form counting

**URL:** <https://forum.adalo.com/t/automatic-form-counting/3932>\
**Category:** Get Help\
**Created:** [September 10, 2020, 5:38am UTC](https://forum.adalo.com/t/automatic-form-counting/3932 "2020-09-10T05:38:16Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![JuchelkaPetr](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JuchelkaPetr](https://forum.adalo.com/u/JuchelkaPetr)\
**Post date:** [September 10, 2020, 5:38am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/1 "2020-09-10T05:38:16Z")

</div>

Hi,

is it possible to automatically calculate with the values that someone has just entered into the form and then save them in the database when you click on create/save button?

For example you already have in database some value x=100 and then you enter the value into the form y=10. Is it possible to automate x\*y=z and save it to the database?

Thanks

Petr

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [September 10, 2020, 8:01am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/2 "2020-09-10T08:01:13Z")

</div>

Hi @JuchelkaPetr,

Yes, it is possible. If you want the new value to be displayed instantly, you can add a custom formula to the text field.  
And you can save the calculated value to the database by adding Action to the button.

---

<div class="post-metadata">

**Author:** ![JuchelkaPetr](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JuchelkaPetr](https://forum.adalo.com/u/JuchelkaPetr)\
**Post date:** [September 10, 2020, 8:54am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/3 "2020-09-10T08:54:33Z")

</div>

Thanks, but do you know why I cant see form inputs in the options?

 ![Snímek obrazovky 2020-09-10 v 10.53.06](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/0/00614ea8034a8c8d496689a3f582374d207cfd9a.png) ![Snímek obrazovky 2020-09-10 v 10.51.54](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/a/a77b0ca5c9575ffd65cb7c71cb19c213fb6cf775.png)

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [September 10, 2020, 9:02am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/4 "2020-09-10T09:02:42Z")

</div>

@JuchelkaPetr you will have to use custom inputs to make it work.  
I think it doesn’t work with forms at the moment.

---

<div class="post-metadata">

**Author:** ![JuchelkaPetr](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JuchelkaPetr](https://forum.adalo.com/u/JuchelkaPetr)\
**Post date:** [September 10, 2020, 10:21am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/5 "2020-09-10T10:21:44Z")

</div>

But it is possible after that make a SUM of that text column? Even if there is a number? Thank for your help.

 ![Snímek obrazovky 2020-09-10 v 12.19.57](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/c/c540299c8a3faf68a10b30259f58bff311abe943.png)

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [September 10, 2020, 10:24am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/6 "2020-09-10T10:24:31Z")

</div>

You can use built-in “Sum”, “Average” etc. only for Number variables, not the text ones.  
What are you trying to achieve? May be there is another way to do that 🙂

---

<div class="post-metadata">

**Author:** ![JuchelkaPetr](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JuchelkaPetr](https://forum.adalo.com/u/JuchelkaPetr)\
**Post date:** [September 10, 2020, 10:39am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/7 "2020-09-10T10:39:25Z")

</div>

I’m trying to make a company statement of work in our construction company. I want the workers to be able to record the work themselves.

So I have individual items they work on, each item has its value for which they do the work.

So I determine the value they work for (x). And they fill in the form once a month in the form, how much of this item they worked (y). So I need to multiply x \* y=z to write in the database that (z) and then add up for all items how much they worked (SUM of all Z).

As you can see, today I can read from the table the individual items on which they work on a given construction site. And I need them to be able to write once a month for each item, how much they made and how much money they make for all the items together.

 ![Snímek obrazovky 2020-09-10 v 12.38.28](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/f/f26f0e7fe2e848b3bcd3c7093c26ab0548f020b8.png) ![Snímek obrazovky 2020-09-10 v 12.38.15](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/1/11ae7c16531731c04024876ed0d10096976063d6.png)

---

<div class="post-metadata">

**Author:** ![JuchelkaPetr](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JuchelkaPetr](https://forum.adalo.com/u/JuchelkaPetr)\
**Post date:** [September 10, 2020, 10:42am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/8 "2020-09-10T10:42:43Z")

</div>

Once more in english

 ![Snímek obrazovky 2020-09-10 v 12.42.19](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/0/0f615f9cecb80b8a2df2e154f70c17b5d2e21f07.png)

---

<div class="post-metadata">

**Author:** ![JuchelkaPetr](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JuchelkaPetr](https://forum.adalo.com/u/JuchelkaPetr)\
**Post date:** [September 10, 2020, 10:49am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/9 "2020-09-10T10:49:36Z")

</div>

So now I can save in database X, Y as number and Z as a text but I need somehow save Z as number so I can make a sum of Z

 ![Snímek obrazovky 2020-09-10 v 12.47.21](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/9/91836e98ea9125da52da32b4d634bfbf1d5b78d0.png)

---

<div class="post-metadata">

**Author:** ![Victor](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/victor/32/2054_2.png) [@Victor](https://forum.adalo.com/u/Victor)\
**Post date:** [September 10, 2020, 1:11pm UTC](https://forum.adalo.com/t/automatic-form-counting/3932/10 "2020-09-10T13:11:14Z")

</div>

Ok, now I see.  
Why have you decided to store Z as Text?

As for me, the database might look like the following:  
DB-Workers [Name; CostPerHour; link to DB-Works - one worker can do many DB-Works]  
DB-Projects [ProjectName; link to DB-Works - one project can have many DB-Works]  
DB-WorkTypes [WorkType name - to be able to select from list]  
DB-Works [WorkName; DB-Project; DBWorkType; DB-Worker who does it, Number of hours, Total cost for this work].

So when the worker adds some work, the extra record in DB-Works collection will be created. When creating this record, you set:

- WorkName - text, coud be anything
- DB-Project - project should be selected
- DB-WorkType - which type of work, selected by worker
- DB-Worker - set automatically (if the worker adds the work) or manually (if manager does it)
- Number of Hours - set manually
- Total Cost - calculated based on DBWorker-\>CostPerHour \* Number of Hours.

Then you can have the sum of all TotalCosts for the worker, if you create a list of DB-Works filtered by DB-Worker.

---

<div class="post-metadata">

**Author:** ![JuchelkaPetr](https://avatars.discourse-cdn.com/v4/letter/j/dfb087/32.png) [@JuchelkaPetr](https://forum.adalo.com/u/JuchelkaPetr)\
**Post date:** [September 16, 2020, 10:23am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/11 "2020-09-16T10:23:23Z")

</div>

Hi Victor,

sorry that I response after long time. I didn’t have time to build an application. I still can’t understand how to enter an order to calculate Total cost when it can’t be used as custom formula for a number in DB.

thanks

Petr

---

<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:** [September 26, 2020, 10:23am UTC](https://forum.adalo.com/t/automatic-form-counting/3932/12 "2020-09-26T10:23:29Z")

</div>

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