- 07 Oct 2020
- 3 Minutes to read
- Print
- DarkLight
Using the Mapping Editor
- Updated on 07 Oct 2020
- 3 Minutes to read
- Print
- DarkLight
Overview
The Mapping Editor offers an alternative to defining input/output values and is most commonly referenced when the Edit Input Mappings button is selected from the Flow step properties. The Mapping Editor also appears in a smaller version when using the Select From Flow mapping type in the Flow step properties. The benefit of using this editor is that it offers a more spacious visual breakdown of the data that can be used for definition within the Flow. Both instances of the Mapping Editor are described in the sections below.
Example
This example has a Flow that uses a Get All Account (Integration > Internal Services > AccountService > GetAll) step to receive data on the accounts in the Decisions environment. The data is output from that step and passes along to a Show Popup step. This setup will be used to explore both instances of the Mapping Editor. For the purpose of this example, the GetAll output is renamed to Fetched Accounts so that it can be better represented in the editor.
Edit Input Mappings
For every step that has an input, the Edit Input Mappings button will always appear at the top of the step Properties tab. In parenthesis next to this button is the count of how many inputs the step has. It is important to note that all inputs on a step need to have a mapping type, but they do not all need to be defined with a value. Some inputs do require definition, lest the system will throw an exception without one.
The Input Mapping: Show Popup window uses the Mapping Editor interface to present a clean visual of available data on the left and expected step inputs on the right. In the screenshot below, the Show Popup step has access to all of the data available before it in the Flow. The Fetched Accounts list contains a list of all the Decisions accounts found in the environment. Using the arrow to expand the Fetched Accounts will show all of the available properties associated with the Accounts datatype.
All of these properties are received as lists because when they are expanded, there are typically four options for how the property can be mapped. The Message input of the Show Popup step is expected to receive a single String input. While an entire list of Account type objects cannot be mapped to this input, the first email of all the emails in the account list can, since it is a String. Once the list of objects and the properties are expanded, a click/drag motion can be used to connect the data to the input. Doing this creates a line indicating that the Message of the Show Popup step will be defined with the First of All Email Address from Fetched Accounts.
- All Items As Array: Passes all of the available items of the property as a list. Expanding this option further will only show a continuation of the available mapping options.
- Count: Passes all of the available items as a number (Int32) value indicating the total amount of items.
- First: Passes the first single item of the property.
- Last: Passes the last single item of the property.
Select From Flow
When using the Select From Flow mapping type for an input in the Properties tab of a step, the Pick Data window will appear, showing another instance of the Mapping Editor. This view takes a more compact approach as all of the inputs are not listed. This mapping type indicates that a piece of data must be chosen for the corresponding input only.
Instead of using an arrow to expose datatype properties, this form of the Mapping Editor will show the available properties after selecting the datatype. In the example below, the Fetched Accounts list is selected, which exposes the available properties. From there, the All Email Address property is selected, which exposes the First mapping used for the Show Popup input.
Additional Notes
In the example above, the All Email Address property worked for the Message input because an email address is typically entered as a plain text string. The available properties for items of a certain type (like [Accounts]) may include some properties that use composite types (like [TypeOfAccount]). The screenshot below shows the First property of All Account Type as a [TypeOfAccount] value; whereas, the First property of All Email Address is a [String] value.
The exposed properties of the data types found in the Mapping Editor do not always need to be used for defining inputs. In the example below, a Form is expecting a string list of email addresses to populate a dropdown. Using the Mapping Editor, the entire All Email Address property can be used to define the input for the Form, without having any additional properties selected.