(Example) Schema Mapper

This example shows how to map variables in the Schema Mapper.

Background and Setup

Other Examples

Good to Know

  • The Schema Mapper is used to connect, or map, variables in one data source to variables in a different data source. When you map the variables, it synchronizes their values in the two data sources. The examples in this topic show various ways to map variables with the Schema Mapper.
  • In the Schema Mapper, the source and the target variables show in a tree view in the left and right panes. You can drag and drop from one pane to the other. If you map the variables:
    • A green line indicates that the data type of the source and target variables are the same and no data conversion is required.
    • A blue line indicates that the data type of source and target variables are different. The data conversion is required to map the variables. To change the data types of the variables, refer to:

How to Start

  1. You can open the Schema Mapper from many places in AgilePoint NX where a group of variables in one data source must exchange data with another data source. Usually the Schema Mapper opens with a button called Map Schema.

Example 1: Map One Variable

This example shows how to map one variable in the Schema Mapper.

Good to Know

Procedure

  1. On the Schema Mapper screen, map the join_url response to MeetingURL form control.

    Schema Mapper Map Variable

Example 2: Map More Than One Variable

This example shows how to map more than one variable in the Schema Mapper.

Good to Know

Procedure

  1. On the Schema Mapper screen, map the cells in the Excel file to the form controls as shown in this table.
    Excel Template Cell NameForm Fields
    AccountNameAccountName__u
    EmailIdEmailId__u
    PaymentTermsPaymentTerms__u
    PhonePhone__u
    PoAmountPOAmount__u
    PoNumberCutomerPONumber__u

    Schema Mapper Map Variable

Example 3: Map Variables with Auto Map

This example shows how to use the Auto Map method to map the variables in the Schema Mapper.

Good to Know

  • Auto Map connects all variables in the source and the target that have the same name, regardless of data type. Auto Map does not map variables with different names.
  • To map variables with different names, click the variables to map them. For more information, refer to Map More Than One Variable.
  • If you map two variables that have different data types, by default, the Schema Mapper uses the Default Conversion method to change the data types. For more information, refer to Default Data Conversion.

    You can change the Default Conversion method to the Custom Data Conversion method to change the data types. For more information, refer to Custom Data Conversion.

  • When more than one variable has the same name in the source, the target, or both data sources, the Auto Map feature may not map the variables as you expect. In this case, change the mapping as necessary after you click Auto Map.
  • This example shows how to map variables in the Create Record activity in the Data Entities tab.

    A similar procedure can be used in the Schema Mapper anywhere it is accessed in AgilePoint NX.

Procedure

  1. On the Schema Mapper screen, click Auto Map.

    Schema Mapper Map Variable

    The Schema Mapper maps the variables that have the same name.


    Schema Mapper Map Variable
  2. (Optional) Change the connections created by the Auto Map feature that are not correct or do not match your requirements.

    Change Variable

Example 4: Default Data Conversion

This example shows how to use the Default Conversion method to map the variables in the Schema Mapper.

Good to Know

Procedure

  1. On the Schema Mapper screen, map the Budget response to the QuotationTotal form control.
    • The Budget variable has an integer data type.
    • The QuotationTotal variable has a string data type.
    • The Default Conversion method changes the integer value to a string value.

    Schema Mapper Map Variable

Example 5: Custom Data Conversion

This example shows how to use the Custom Data Conversion method to map the variables in the Schema Mapper.

Good to Know

  • In this example, the Custom Data Conversion method changes the string value from the InvoiceDate variable to a date-time value and stores it in the InvoiceDate form control in this format:
    • dd/MM/yyyy HH:mm:ss tt
  • Use the Custom Data Conversion method to change the data type to a specific format.
  • You can configure the Custom Data Conversion method for one variable at a time. In other words, Custom Data Conversion is specific to one mapped variable.
  • For a Custom Data Conversion method, the value for the Custom Mapping Method Code must be a C# code snippet.
  • If you map two variables that have different data types, by default, the Schema Mapper uses the Default Conversion method to change the data types.

    For more information, refer to Default Data Conversion.

  • This example shows how to map a variable in the Retrieve Records activity in the Data Entities tab.

    A similar procedure can be used in the Schema Mapper anywhere it is accessed in AgilePoint NX.

Procedure

  1. On the Schema Mapper screen, map the InvoiceDate response to the InvoiceDate_u form control.

    Schema Mapper Map Variable
  2. Click the blue line.

    Schema Mapper Click Blue Line
  3. Select Custom Data Conversion.

    Schema Mapper Select Custom Data Conversion
  4. Click Add.

    Schema Mapper Click Add
  5. On the Custom Mapping screen, in the Custom Mapping Method Code field, enter return Convert.ToDateTime("1/1/2010 12:10:15 PM");.

    Schema Mapper Click Add
  6. Click Validate.

    Schema Mapper Click Validate

    If the code for the custom data conversion is correct, a confirmation message shows.


    Schema Mapper Confirmation Message
  7. Click Finish.