Create and apply a micro flow to calculate the value for an attribute.

0
Hi.  I have a form which captures some data in text boxes. I would like to multiply values 'A' and 'B' from a form and display answer 'C' read-only on another page. I am assuming that this is done by calculating the value of the attribute with a microflow. I have attempted a variety of approaches using ('A' * 'B'), but always seem to face some sort of error. Can anyone explain the proper steps for doing this? Many thanks Austin
asked
1 answers
7

Hi Austin!

Can you specify what error you are encountering?

You can use Mendix functions to multiply numbers, not textual input, so make sure that you define A and B as Integers in your domain model. Also see the Mendix documentation for more information about arithmetic functions.
https://docs.mendix.com/refguide/arithmetic-expressions

A solution could be:
1. Set up your domain model in a correct fashion. The values should be Integers (numerical values).

2. Create a form that only shows Value A and Value B:

3. You need to create a Multiply entity first, so make a Microflow that a. does this, b. opens the form and passes the Multiply entity to the form that you just created:

4. On the page that you created, create a microflow that calculates the values of A and B and changes the value C of the Multiply object:

 

5. Finally, create a new form that shows the value of C and make sure that the input box has its Editability set to Never :

 

6. Lastly, connect your new read-only form to the calculating microflow, showing the result of the calculation in your read-only form!

 

What it looks like:

Good luck!

 

answered