Forum Academy Marketplace Showcase Pricing Features

Text Body Dynamically Pulled From Other Text's Body?

I have Text A whose body is the result of a math.js calculation. I want Text B’s body to duplicate whatever is contained in Text A’s body. When I click in Text B’s body editor and click “Insert Dynamic Data” Text A is not an option. Is there a hack for this? I know I could save Text A’s value into a database and pull it from there, but I would rather not have to do that.

To provide context; Text A is pretty much a subtotal. I want Text B to be the total, after discounts have been applied to the subtotal.

I think you would have the math.js value within Text B contain the math.js of Text A, and then adjust the calculation in Text B to reflect what the subtotal would be? Or am I missing something?

Yes, that would certainly work. Just seems like a silly solution having all of these API calls. Won’t that affect performance?

Also, consider saving a Texts body data to the database… I’ll have to have yet another API call there. If it’s the only viable solution, I’ll do it, but being able to pull a “Text’s Value” would be nice.

If the calculation can be stored into dynamic data, you can then reuse it in multiple textboxes.

One way is to have the calculation as the initial content of an input field.

Another way is to choose a workflow action “Set state of an element”, create a custom state on an element or the page, and for the value do the calculation. Then the calculation result is dynamic data of a custom state.

1 Like