Adding a row to RG & calculating total

Hi all,

I have 2 questions:

  1. I have a RG in an invoice where a user can search for their products and add that product to the invoice. How can I get the RG to dynamically add a new row as the user enters data?

  2. I have the “AMOUNT” calculated in the table but how can I calculate out the total amount (shown as "subtotal below the table) if there are multiple “products” added to the invoice? I can’t seem to figure that part out.

reference image:

Thanks!

1 Like

have you resolved this?

There’s a couple ways to do this, did you end up figuring it out?

It can done a few ways I think. Are you on a paid plan with backend workflows enabled?

please can you help with the calculating total in RG, [i have not moved to a paid plan ] how can you be of help?

With the free plan I think this would work:

So his original screenshot he says he’s already calculating the total of that row (price x quantity) so from that calculation you can write it to the database as a “Item Total” for example. (If he’s writing the totals to the database) Otherwise the item total needs to be calculated and written to the database first of course

Then if you put some text outside the repeating group you can make the text "Repeating group’s list of [thing name]:each item’s Item Total:sum

If you want to write the Subtotal to the database that might need some more steps.

On the paid plan you can do a “database trigger” where it’s always watching for values changing so when a value is changed you can just trigger a re-calculation. But it can be done on-page I think with a few workarounds

thanks a lot of your time, this a little tricky, considering the fact that this is happening inside a user shopping cart and subtotal is for more than one product, saving to database first removes the smoothness in the user experience, is there a way we can add value of all subtotal input in real time like you get in excel then you can save to database when users choose to pay.

Let me test it on my app, I just re-tested my server-side method using the database triggers and it’s like a 1/4 second lag to give me the grand total after the tax, etc… But since that’s not an option on free plan let me try something else.

1 Like

thanks i am patiently waiting