Saving the value of a text field

I have a dynamic text field. It’s the current row price x quantity input field. I was wondering how I can update the data thing total field to be whatever the current value of the text field. Hope this makes sense and thanks for your help.



total2

1 Like

You can have an event trigger

When Value of Quantity Input changes > Make changes to the current row Invoice and update the Total

Or at the end when a person performs the checkout.
Run Workflow on list of items and update total at that time

Sorry I don’t understand. I currently have the input quantity as auto binding so it’s automatically updating the quantity fields. I’m worried about the total field. I currently have a text field that is dynamic and I want the value of the total text field to be the total data field value. Hope that makes sense

How is your invoice database setup ? Are these “list of services” and “list of numbers” ?

I guess your RG is of type “service”, then at the end of the checkout you can :
image

However WARNING : this seems to manipulate payment stuff. Remember that anything done at the page workflow level is visible by the user and can be manipulated. (the end user could modify the pricing and checkout a bunch of stuff for 0€)

You need to use backend workflow if you want to implement better security.

Are you saying what you’re currently doing is not working?

here is my database setup for invoice
dbi

it showing the right text but i need that text field to be saved in the database under total.

@kh.hraza Do I understand the task correctly? You need to multiply Number of Quantity element to a price of one and return a total? If yes, check out below.

A. Set a state of input which is going to store number of Quantity items.
i → create custom state → Name:Quantity1 → Datatype: Number

B. Set a workflow.
Click on workflow → Event: InputChanged (choose changed input) → Set state of an element → Name: Element Where you decide to store Custom State
Value: value from your input

C. Use value from custom state in your formula to return Total.
CustomState:Name * (Price of one Item of whatever it is in your database or row cell)

There are few disadvantageous of using custom states but on small amount of purchases it is not that significant.
Wish you all the best.

In that case, you’ll need to update the database any time either the quantity changes (assuming the price will never change)

You can do that on the page, using a ‘when input value is changed’ event, or you can do it with a database trigger on the backend.

@adamhholmes
@rodjackson087 The value will be changed anyway each time the input is changed as an input is auto-binded.

The rest of your point and how it is related to my previous post I dont undertand.

no… he’s trying to update the Total… not the quantity (you can’t use autobinding for that).

I can’t get it to work.

You can only make changes to things from your database…

So the thing to change needs to be something from your database (i.e. an Invoice)

Currently, your expression is a yes/no (which doesn’t make any sense, hence why it’s red)

So just define thing (Invoice) you want to change, then define the fields you want to change, and their values.

That’s the problem I don’t know how to do this part of your message “So just define thing (Invoice) you want to change, then define the fields you wand to change, and their values.” I attempted it again but still didn’t work. I’ll add a picture of the error also.


total5

Your ‘Total’ DB field is a Number…

So the value needs to be a Number.

How can I make the text field a number?

You can’t refer to a text element in another expression if that’s what you’re talking about.

So just refer to it’s datasource, or create the expression again.

that text element takes the quantity and times it by price. Which is what I want the total data field to be. So if I can’t use that text element to update the total data field for invoice. How would I do it?

use the quantity multiplied by the price.

But where do I use that at? Sorry I’m new to bubble.