- 14 Feb 2022
- 3 Minutes to read
Sub Dialog Data Flow
- Updated on 14 Feb 2022
- 3 Minutes to read
Sub Dialog Data Flows show a smaller, more targeted informational view of another Form control from the parent form. This can extend user interaction while preventing clutter.
This example will display a Form with a Data Grid showing a list of all current accounts. There will be two buttons on the Form; one will be a Sub Dialog Button that will create a new account; the second button will close the Form.
- In a Designer Folder, select Create Flow from the bottom action panel.
- In the Create Flow dialog, select Default Flow. Name the flow “Main Flow”, select Create.
- In the Flow Designer, add a GetAll step from Integration > Internal Services > Account Service.
- Add the Show Form after the GetAll step, select PICK OR CREATE FORM, and create a new Form to open it in the Form Designer.
- In the Form Designer, add a Buttons to the base of the Form named 'Submit'. Add a Data Grid to the Form, from Data > Data Grid in the Form Controls panel.
- Configure the Data Grid by navigating to the Properties panel. Under Input Data, choose Account [DecisionsFramework.ServiceLayer.Services.Accounts] as the Type. Type “Account” under Data Name.
After the Type is chosen, Column Information > Columns will automatically update with the available fields. Delete all but EmailAddress, FirstName, and LastName.
- In the Toolbox, expand Actions > Sub Dialog, drag and drop a Sub Dialog Button next to the 'Submit' Button. Under Data > Text type “Add New Account” to name the Sub Dialog Button.
- Under Input Data select PICK OR CREATE FLOW ID. Create a new Flow and select Sub Dialog Data Flow to open it in the Flow Designer.
- In the Flow Designer, select SETUP INPUT DATA.
- Next, add a Show Form step from the Toolbox. Create a new Form to open it in the Form Designer. Name it 'Add New Account Form'.
- Place three Text Boxes with the corresponding Labels: Email Address, First Name, and Last Name. Add two Buttons (Add and Cancel) as shown below.
- Save and close the Form.
- Add the another Get All step to the dialog Flow to grab the list of Accounts within this Flow logic.
- Add an Add New Account step from Integration > Internal Services > Account Service in the Toolbox on the Add outcome path from the Form. For the Cancel path, connect it to an end step.
- In the Add New Account step's 'account' Input, select the Build Data mapping type.
Select the pencil icon to choose which Properties to map. Choose Email Address, First Name, and Last Name. For each property, choose Select From Flow and choose the matching Text Box.
- For the 'member Of' Input, select the Constant mapping type. Choose Add New to pick which group to add the new account. This example selects 'Designer'. Set the 'password' Input to Constant and enter a password that the new account owner can change after logging in.
- Add a Get By ID step from Integration > Internal Services > Account Service in the Toolbox. Under Inputs > id, choose AddNewAccount1_Output.
- On the outcome of the GetByID step, add an Add Item to List Step from Data List in the Steps panel. Under Inputs for New Item, choose Select From Flow and choose GetByID1_Output. For Original List, select Select From Flow and select GetAll1_Output to get the list of all Accounts.
On the Outputs of this step, Change Value of New List to GetAll1_Output to update the old list on the first Form to display the newly added account.
- Save and close the Sub Dialog Rule Flow to return to the Form Designer. Ensure the Form's 'Account' input is set to GetAll1_Output in the parent Form. Save and close the Form to return to the parent Flow Designer.
- Select Debug in the Flow Designer. Select START DEBUGGING.
- The Form displays showing the list of Accounts. Select the Add New Account button.
- The Sub Dialog Flow runs and displays the form. Fill in the TextBoxes and select Add.
When the Sub Dialog closes, the Main Form is still displayed and will show the accounts' updated list.