Show/Hide Toolbars

PerfectApps™ Help Guide

Navigation: Designing an App > Adding Behaviors

Calculations and Setting Field Values

Scroll Prev Top Next More

Use the Set Field command to add the values of numeric fields together and then populate an app field with the calculated value.

 

Document Icon

1.With an app loaded in the App Designer in Layout view, select the field or button object

2.On the Properties panel, choose the event that should trigger the Set Field behavior to run. PerfectApps switches to the Behavior view.

flag_green

Example: When a user clicks the Next button, the Set Field behavior should run in order to populate a Subtotal field on the app. So, the app object that will trigger the behavior event is the Next button and the event is Button Is Pressed.

 

3.From the Objects Commands section of the Toolbox, drag and drop the Set Field command onto the behavior canvas.

4.On the Properties panel under the Field section, click Select. Choose the field where the result of the calculation should be written.

5.In the Value section of the Properties panel, select the data that should populate the field.

flag_green

Other options allow you to populate the field with text or the contents of another field or other data that is not the result of a calculation. See the Set Field reference topic for a full description of the Value properties.

 

6.To populate the field with a calculated value, choose Formula and click Compose. PerfectApps displays the Formula Editor.

flag_green

See the Formula and Condition Editor topics for more information.

 

7.Select the <empty> line and then select Value of a Field on the right.

8.Click Select and locate the first field to act as part of the calculation.

9.Click Add Line.

10. Click on the added <empty> line and then select Value of a Field on the right.

11. To change the operator from the default plus (+) sign, click the + and choose a different operator from the list.

12. Click OK.

You have now built a formula that evaluates the values of two fields and places the resulting calculation in an app field.

 

See also: Conditional Behavior

 

Return to Adding Behaviors, Designing an App