User Controls
  • 02 Nov 2022
  • 2 Minutes to read
  • Dark
    Light

User Controls

  • Dark
    Light

Article Summary

Overview

User Controls are a Form element that is used to create smaller miniature Forms that can be used on a different. They are a small template for a piece of a Form, that can be used. A User Control's objective empowers Designers with the ability to create reusable groups of controls for Forms. It helps for increased maintainability since one change on the User Control will apply to all Forms that use the control. Multiple User Controls can be added to multiple Forms. 


Example

  1. In a Designer Project, click CREATE FORM and in the resulting Create Form window, select CREATE.
  2. In the Create Form window, click User Control, then select and name the User Defined Control.
  3. In the Form Designer, drag any Form components onto the Form.
  4. Then, save and close the Form Designer.
  5. Back in the Designer Project Folder, create a normal Form.

  6. In the Form Designer, expand USER CONTROLS > [Existing User Controls] > [Current Folder].

  7. Drag the recently created User Control component onto the Form.

  8. Add a Button [Submit], then save and close the Form.

  9. Right-click the Form that contains the User Control, then click 'Run Form'.


    Interacting with the Form

  10. In the Form Designer, add a Currency Box with the corresponding Label [Item Total].
  11. In the Properties panel of the Form, locate FORM RULES > Active Form Flows, then click ADD.
  12. Click EDIT RULE FLOW under FLOW DATA in the Add Active Form Flows window.
  13. In the Rule Designer, drag and drop an Evaluate Dynamic Expression step from the Toolbox and connect it to a Subtract step and the Start step.
  14. With the Evaluate Dynamic Expression step selected, navigate to INPUTS > Expression and change the input mapping to Merge Plain Text. 
  15. In the Merge Text Editor window, add a parenthesis, then FormData.UserDefined.Price.Currency.TwoDecimals from the left Folder tree. Then, add an asterisk (*).
  16. Next, add Form.Data.UserDefined.selectedDiscount with another parenthesis. SAVE the merged text.
    Please navigate the Evaluate Expressions article for more information on how to use Evaluate Dynamic Expression steps.
  17. With the Subtract step selected, navigate to the Properties panel > INPUTS > From Value field and change the input mapping to Select From Flow. 
  18. Locate and select FormData.UserDefined.Price.
  19. Then, for the Subtract Value field, change the input mapping to Select From Flow also and locate EvaluateDynamicExpression1_Output.
  20. Next, navigate to the FORM RULES section and connect a Set Control Value to the Subtract step and End step.
  21. In the Properties panel > INPUTS > Form Control field, change the input mapping to Select From Flow and locate FormData.ItemTotalCurrencyBox.
  22. Then, in the Value field, change the input mapping to Select From Flow and locate Subtract1_Output.
  23. Save and close this Flow Designer.
  24. In the Edit Active Form Flows window, under ADVANCED select User Defined and enable Value Changed and Run at Startup. Click OK.
  25. Next, add the Form to a Flow and set all inputs to Ignore.
  26. Select Debug from the top action panel.

  27. As the Debugger runs, manipulate the data to see how the User Controls interact with the other Form components.


Was this article helpful?

What's Next