Create Repeater Form Control
- Updated on 22 Feb 2017
- 4 minutes to read
This tutorial demonstrates how to create and use Repeater Form Control in Decisions 4.0 . Repeater Form Control is custom User Defined control that can be used on any Form as other Form Controls that have input and output data. Repeater Form Control takes in a List of defined Type and outputs edited List of the same Type . Repeater Form Control can be used in cases where user needs to edit/add/remove entities from the List on the Form .
In this example we are going to create a Repeater Form Control that takes in a List of all Accounts in a System and displays a Text Box for user to be able to edit Email Address . Then, we are going to create a Flow with a Form on it. This Form will display our Repeater Form Control with the ability to Add or Remove Accounts in List .
We begin in the Designer Folder with clicking Create Form > Data Repeater > Base Data Repeater on Folder Actions Panel.
Then, we Name our Repeater Control and click CREATE to continue.
Repeater Form Control is basically a Form that can be embedded into other Forms . In the Form Designer we locateForm Data Input Type settings and Pick Account . Click Ok to continue.
Then, we switch our Tool Box to Data tab. In Data tab we expand Form Data . In this example our Form Data is an Account . We locate Email Address property.
Next, we drag our Email Address data to the work-space, define this control to be a Text Box , and click Shift + Enter for designer to automatically create a Label for this Control .
This completes our Repeater Form Control design. We can Save the Form and close Form Designer.
Back in the Designer Folder we click Create Flow on the Folder Actions Panel.
In the resulting window we Name the Flow and click CREATE to proceed to the Flow Designer .
In the Flow Designer we add Get All step from Integrations > All Integrations > Internal Services > Account Service category.
On the outcome from Get All step we add Show Form step from Favorite Steps category.
Then, we Name the Form and click Create to proceed to the Form Designer.
In the Form Designer we expand User Controls > [Existing Controls] > [Current Folder] category in the Tool Box and drag our Repeater Form Control to the work-space.
Our Repeater Control shows on the Form . We also add Button control to our Form for User to be able to submit the Form .
Next, from User Controls category in the Tool Box we add Data Repeater Add Button and Data Repeater Remove Button controls. These button controls allow user to add or remove Entities (in this case Accounts) in the Data Repeater Control input List .
Then, we select and configure our Data Repeater Control on the Form . First, we locate Selection Type settings and pick one of the following:
- None (no visible selection indicator)
- Visual Indicator (a marker on the left side of the Repeater Control)
- Line Number (numerical indicator)
In this example we pick Visual Indicator.
Next, we can adjust our Line Indicator settings:
- Line Indicator Width
- Line Indicator Color
- Line Indicator Selected Color
- Font For Line Numbers
In this example we keep them default.
Then we locate Input Settings and pick our Add/Remove Buttons for Data Repeater Control.
This completes our Form design. We can save the Form and close Form Designer.
Back in the Flow Designer we select our Show Form step to configure Form Input data. We locate Inputs > Account Data Repeater Data settings. For Mapping Type we use Select Value . Then, using Path Picker we selectGet All_Output outcome data from our Get All step (list of all Accounts in System).
Then, we connect the outcome from our Show Form step to the End Step in our Flow . This completes our Flow . We can click Debug Flow on the top panel of the Flow Designer to test our Flow .
Our Form pops up in the Debugger . We can see that our Data Repeater Control is generated for eachAccount Entity passed in. We can use Remove button to remove Accounts from the Input List.
Removed Accounts disappear from our Form .
If we click Add Button , new Repeater Control shows up and new Account Entity is being added to Form Output list*.* In this example we can define an Email Address for the Account that we add to output list. Then, we click Done .
Our Flow runs to the End Step with no issues. We select Show Form step on the execution diagram and click View Output Data.
We should be able to see that our Form outputs a list of Accounts that were displayed on the Form when we submitted it.
Also, the last item in the output list is the Account that we added with Data Repeater Control . This Account has all properties empty except Email Address field that we defined in the Data Repeater Control.
Note: These entities are not automatically saved in the system. The outcome data from the Data Repeater Control lives only within current Flow execution and can be used for further manipulations.