Hi there,
I’m trying to add up the sum of three fields to display in another field. This all needs to be done upon text entry into the input fields.
In addition the number in the first field needs to display on a total line below it.
I’m running into problems with getting the sum to display. Instead it shows the actual text [[Input1 + Input2 + Input3]] not the sum of the numbers. You can see this on the screenshot.
Sure. Give me a minute to send the actual file. I had defined the variables (although maybe incorrectly). In the screencap above though I had removed those and just used the name of the item in the equation. This did not help either.
It looks like you have three variables that are undefined. And that’s why it’s failing. You’re using variables AuthorizedAmountMaster, OutstandingBalance, and NewFunds but those are not defined as local variables or global variables so the expression fails.
It looks like you were trying to use the widget names of the other text fields. You can’t do that. Widget names are not unique so even if you could, it wouldn’t simply work that way. What if you have 20 widgets named OutstandingBalance?
Instead you should use local variables. Open the expression editor (the fx button) and in the bottom half of the window add local variables for each text field widget. Name them whatever you want, and set them to each widget’s text.
Example: LVAR1 = text on widget OutstandingBalance
Then you can use the local variables in your expression.
[[LVAR1 + LVAR2 + LVAR3]]
I suspect this is what the example you referenced did, but when you copied it you did not set the local variables.
Yes, in your case. It’s the Set Text action that you want to use to show the sum.
You had a Set Text action that looked like: [[Input1 + Input2 + Inpput3]]. You need to define those variables for the Set Text action to work.
[[Input1 + Input2 + Inpput3]]
And in the expression editor for this action:
Input1 = Text on widget SomeWidget
Input2 = Text on widget SomeOtherWIdget
Input3 = Text on widget AnotherWidget
Close, but you’re setting the local variables on an empty Set Variable action and then doing nothing instead of on the Set Text action where you want to use them.