Using mapping expression in graphical interface

Adeptia Connect offers you two kind of interfaces (textual and graphical) to create and use mapping rules while mapping the source and destination elements. The interfaces are known as "Textual Rule" and "Graphical Rule". The graphical interface makes it easy for you to see the graphical representation of elements and allows you to perform mapping by connecting source element to any target element or to any mapping functions.  Applying mapping rule is also very convenient as you can see the functions graphically and use the context menu options to connect to both source and target elements.

This section guides you on how to use the Graphical rule option while mapping the elements and also introduces the different components of this option.

Elements of Graphical Rule

The Mapping Expression area has a floating menu that contains two options for you to switch between the Graphical and Textual rule. You can drag this floating menu anywhere in the Mapping Expression area. 

Graphical elements are components which are used to represent any source, destination, mapping function, or parameter elements visually in Mapping Expression area. The following types of annotations describe the type, behavior, and functioning of the graphical interface and their elements. 

  • Floating Menu
  • Inputs
  • Label
  • Element type
  • Context Menu



Floating Menu

Floating menu contains two options for you to switch between the Graphical and Textual rule. You can drag this floating menu anywhere in the Mapping Expression area

Inputs

The number of inputs a mapping function or a target element can have. Also, you can drag a line from input element to this section to use that as an input in this mapping function or target element.

Label

The name of the element.

Element type

Type of element being used in the mapping rule. The following list explains the types of elements:

Element typeDescription
f(x)A mapping function, variable, custom method, key function, context variable, connection variable, etc.
S A source element.
D A destination element.
T  An XSL Template.
VM A Value Map.
C A Constant value.

Context Menu

Context Menu options are used to perform the following actions:

  • To draw the connecting lines to map an element to another element(s).
  • To remove the field/function from the Mapping.
  • To go into More menu option. It contains the following action items:
    • Information option to know the details about the element.
    • Remove Mapping option to remove the mapping from the element.
    • Add As Local Variable option to add the element's syntax/expression as a local variable.

Applying mapping functions using Graphical Rule

Mapping Expression tab gives you two interfaces, Textual and Graphical, to perform the mapping. By default, the Graphical Rule is active.

For quick understanding, you can take a look at this video explaining the concept discussed herein. 




You can switch to the Textual Rule interface by clicking the Textual Rule icon in the floating menu. A warning message is displayed asking for your confirmation, click Yes to switch to Textual Rule. To perform mapping in Textual Rule interface, refer to this document.

You can use the option, Graphical Rule, available under the Mapping Expression tab in the web mapper. 

  1.  Ensure that the source and destination layouts are loaded and all their elements are listed under their respective nodes.
  2. Select a destination element which you want to map. 

    Until you select a destination element first, the Mapping Expression tab will remain grayed out.
  3. Click Mapping Expression tab at the left bottom of the screen.
    The destination element that you have selected will be visible in the mapping expression area.

  4. Double-click a source element that you want to map to the destination element. 
  5. Click a mapping function that you want to use and select the desired sub-function and use it to map the source and destination elements. For example, you can use the Concat sub-function.

    You can also add a parameter in the mapping expression area by double-clicking the parameter's name in the Parameters panel.
  6. Click String mapping function and select Concat sub-function. 
    Once you have all the corresponding graphical elements (source elements, destination element, and mapping sub function) available in the mapping expression area, do the following:

    You can drag and reposition the graphical mapping elements anywhere in the Mapping Expression area.
    1. Click each of the source elements and select the  icon from the Context Menu to connect the source with the respective Inputs of Concat sub-function. 
    2. Click the Concat sub-function and select the  icon from the Context Menu to connect with the destination element. 
      The source elements are now mapped to the destination element using Concat sub-function and the mapping is visible in the mapping panel.



      You can reposition the entire mapping within the Mapping Expression area by clicking anywhere and moving the cursor.

You will be notified of an error message in the Comments section if the mapping function and destination element do not have the proper mapping. 

Color coding of connecting lines

The color of the connecting lines depend upon the following three factors:

ColorDescription
GreenLines connecting two elements will be green in color if the both elements are visible in the current space of Mapping Expression area. 
GrayLines connecting two elements will be gray in color if any of the two elements is not visible in current space of Mapping Expression area. 
OrangeLines connecting two elements will be orange in color if any of the elements is selected. 


You can scroll up and down to view the hidden fields/elements in the Mapping Expression area.

Adding a constant

You can add a Constant while mapping the source and destination elements. This option is visible only when you are applying the graphical mapping rule.

Perform the following steps to add a Constant:

  1. Click  button located at the bottom of the Mapping Expression window. 
    A graphical notation for the Constant will be added to the Mapping Expression area. 
  2. Double-click the Constant notation. 
    Add Constant window appears.
  3. Enter a constant value in the Constant Value field. 
  4. Select the Add Quotes check box if the value is String type.

    The use of Add Quotes depends upon the type of Constant you're using. Refer to the following guideline regarding the use of quotes.

    • Query string - Do not use quotes.
    • Number - No effect of using quotes.
    • String - Use of quotes is mandatory.
    • Boolean value - No effect of using quotes.
  5. Click Ok.
  6. Click the Constant notation and select the  icon from the Context Menu to connect with the destination element. 

Using Lookup mapping function for a reference field in target layout

When the destination element of target layout is a reference field, the Mapping Expression feature gives you an additional option of Lookup Mapping on the floating menu. 

Lookup mapping function is used to set the dynamic value for the reference field by searching a value in the source field that matches the corresponding record of a destination field. For example, if you know the Account name at the source and do not know its respective ID, you may use the Lookup function and find it.    

The Lookup function is supported for the following business applications:

  • BigCommerce
  • FreshBooks
  • Magento
  • QuickBooks
  • Salesforce
  • Service Now
  • Xero
  • Zendesk

Perform the following steps to use the Lookup mapping function:

  1. Select the reference field element for which you want to use Lookup mapping function.
  2. Click Mapping Expression tab at the left bottom of the screen.
    The Lookup option will be become available on the floating menu and you get options in the mapping expression area to choose the reference account.

  3. Select the Lookup option. 



  4. Perform the following steps to define the criteria based on which the reference field value will be fetched:
    1. Select the destination field for which you want to match value at source from the Target Field.
    2. Select Equals operator from the Condition. 

      You will find other operators in case of Service Now application only. Depending on the selected Target Field type (integer, boolean, string, date/time, reference, and GUID) the operators will differ.
    3. Select the source field that should match the value of the selected destination field from the Source Field. 

      You can select multiple fields if you have selected is one of or is not one of operator in the Condition drop-down list. You can select two fields only if you have selected between operator in the Condition drop-down list.