i want to generate value and connect it to dataset

i created an input form and connected it to data collection, the point is, i want to generate a numeric value from the data the user inputs in the site, and to provide it to him in the following page, i.e the user inputs an amount of money, and the site generates the interest that he gets, and shows it in the next page.
i tried many things but i started to think that mathematical functions are not provided in data collections.
my last attempt:
the form is write only connected to the data collection, the user should input a number, and this number should be multiplied by 50 and then provided to the user in the following page,
i added a text input (textinput5) connected it to a field in the data collection and made sure they are both numeric, that user should enter value in textinput4, and another value should be generated in textinput5 and when the user presses submit, all values should be sent to the datab base.
in the submit button i added the following lines:
{
$w(β€œ#textinput5”).value = $w(β€œ#textInput4”).value * 50;
}
the result is that when i press the submit button, the result shows in textinput5 but it doesn’t show in the database, although textinput5 is connected to a field in the database, the result is always 0 in that field in the database
i would be grateful if you tell me how i can do such an operation as i tried many different things
thank you

1 Like

You are in the right direction.
Instead of setting the product value (input4 X 50) to input5 set it to the dataset directly.

const withInterest = $w("#textInput4").value * 50;
$w("#dataset1").setFieldValue("theFieldYouConnectedInput5To",withInterest);

wow, thanks that was helpful, it got the job done
thank you for your quick reply :smiley: