# Data valuation before form submit (sum of 2 columns)

**URL:** <https://community.glideapps.com/t/data-valuation-before-form-submit-sum-of-2-columns/72362>\
**Category:** Ask for Help\
**Created:** [April 7, 2024, 9:46am UTC](https://community.glideapps.com/t/data-valuation-before-form-submit-sum-of-2-columns/72362 "2024-04-07T09:46:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexey\_Khrolovich](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alexey_khrolovich/32/37980_2.png) [@Alexey\_Khrolovich](https://community.glideapps.com/u/Alexey_Khrolovich)\
**Post date:** [April 7, 2024, 9:46am UTC](https://community.glideapps.com/t/data-valuation-before-form-submit-sum-of-2-columns/72362/1 "2024-04-07T09:46:19Z")

</div>

Gentlemen, I need advice.

This is the problem: the application in which invoices are entered, when entered, the budget item are selected.  
The application should not allow you to enter an invoice for an amount greater than the budget in a given cost code.  
Accordingly, the line of the “invoice amount” form has a maximum limit of no more than the budget balance. Everything was amazing.  
BUT SUDDENLY  
It has become necessary to save an additional invoice parameter “additional payment” (for example, to the advance invoice you need to add how much the full payment will be) and you no longer need to compare 1 column “invoice amount” with the budget, but the sum of the columns.

So I need to calculate cum of 2 columns and compare it with the budget, but the Form can’t do the calculation. It is possible to determine whether the amount corresponds to the budget only after making an entry.

Then I created fields for these calculations in the user table. There you can immediately calculate the amount and then enter it into the required table by performing an action on the form submit.

So the problem is that the form fields that are written to the User table cannot be specified as required! They show exceed but the user can submit form…

For now I decided this way - I left the comparison of the sum of the columns with the budget in the user’s table, but in the action after the submission I added a condition that if there was an excess, a message was displayed and the record was deleted… of course it doesn’t look elegant. It’s better if the entry simply cannot be made

any ideas?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 7, 2024, 1:41pm UTC](https://community.glideapps.com/t/data-valuation-before-form-submit-sum-of-2-columns/72362/2 "2024-04-07T13:41:52Z")

</div>

I would consider making a custom form if you need to perform real time calculations. You still won’t have the ‘Required’ option, but you can build your own validation and prevent a row from being created if it doesn’t meet your criteria.

> [@How do I create a custom form?](https://community.glideapps.com/t/how-do-i-create-a-custom-form/25014):
>
> I’m just dropping this here so I have something to refer people to when they ask. This is a simple concept app (copyable), that demonstrates the following techniques: Building custom forms for adding and editing list items (as an alternative to the native forms provided by Glide) Preventing duplicate new entries using [User Specific Columns](https://docs.glideapps.com/all/reference/data-editor/user-specific-columns) and [Relations](https://docs.glideapps.com/all/reference/data-editor/computed-columns/relation-column) Enforcing mandatory input items The use of visibility conditions and user specific booleans to control user flow There is nothing particular…

---

<div class="post-metadata">

**Author:** ![Alexey\_Khrolovich](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/alexey_khrolovich/32/37980_2.png) [@Alexey\_Khrolovich](https://community.glideapps.com/u/Alexey_Khrolovich)\
**Post date:** [April 8, 2024, 2:10pm UTC](https://community.glideapps.com/t/data-valuation-before-form-submit-sum-of-2-columns/72362/3 "2024-04-08T14:10:34Z")

</div>

So it is similar to how i calculate now in User table.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [April 8, 2024, 2:38pm UTC](https://community.glideapps.com/t/data-valuation-before-form-submit-sum-of-2-columns/72362/4 "2024-04-08T14:38:22Z")

</div>

Similar, yes, except a custom form does not use a native form at all, and you create your own submit button instead of relying on the default button inside a native form.
