Mapping Form Data Inputs and Outputs
  • 26 Sep 2022
  • 3 Minutes to read
  • Dark
    Light
  This documentation version is deprecated, please click here for the latest version.

Mapping Form Data Inputs and Outputs

  • Dark
    Light

Article summary

Overview

Forms are typically designed to receive some sort of data from the end-user. Whether for a basic or advanced purpose, Forms always send or receive data to the Flow that operates on the back-end. Form data can be used to define mappings on other Form fields, properties of a data structure, inputs of Flow steps, and more. Understanding how Form data moves throughout the back-end Flow will help with using extended Form capabilities like Data Flows or customized validations.

Example

This example will explore a basic use case that contains a Form to receive end-user data and another Form to review the end-user data. Doing this will require that the user data is output from the first Form and used to define inputs on the second Form. Both the End-User and Review Form is attached in the zip file below. Download this attachment and import it into a Decisions environment using our Import/Export Overview, then use the rest of the example to explore input/output mapping with Forms.


  1. Begin in the Designer Folder containing the imported Forms and select the CREATE FLOW button from the bottom action panel.
  2. Choose the default Flow and provide a name for the Flow in the box that appears, then select CREATE.
  3. In the Flow Designer, use the Steps tab on the left to drag a Show Form step from the Favorite Steps section into the workspace.
  4. Connect the outcome path of the Start step to the Show Form step. 
  5. Select the Show Form step and when the properties appear, select the Pick or Create Form button from the top of the Properties tab. Select the existing Form [End-User Form].
  6. On the outcome path of the End-User Form, add another Show Form step to repeat the process, this time selecting the Review Form. Connect the second Show Form step to the End step.
  7. Select the first Show Form step and change all of the input mapping types to Ignore under the Inputs section of the step properties. This setting is not telling Decisions to ignore the inputs as they are entered, but to ignore pre-defining them with input values.
  8. Select the second Show Form step where the inputs for the Review Form should automatically be mapped to the outputs of the End-User Form.
  9. Select the Edit Input Mappings button from the step properties to see how the inputs and outputs are connected.

Debug

  1. Select the Debug button at the top of the Flow Designer and use the Full button to enter debugging. When the end-user Form appears, enter some information and select OK. The Review Form will then appear with the information previously entered.
  2. Select either Show Form step in the debugging screen, then select the execution line. From the menu that appears, select the View Input/Output Data action to see the input and output values of each Form.


Mapping to Properties of an Object

The capture below shows the same example setup as above, but the second Show Form step has been replaced with a Create Data step. This example uses a pre-built data structure called "BasicContactCard" with string properties that include name, email, city, and state. The Create Data step is going to be creating an object of the BasicContactCard type called "User Info". 

When an object is created in Decisions, it can typically be broken down into properties with basic data types (String, Int32, Decimal, etc.) for that object. In the Input Mapping window for the Create Data step, the Build Data mapping type is used on User Info to expose the properties of the expected data type. With the BasicContactCard properties exposed as strings, the output end-user data of the Form is used to define those inputs since they are also strings. 




Was this article helpful?