Skip to main content Skip to complementary content
Close announcements banner

Using external map variables in a map

Create a map that uses an existing external map variable and defines new ones to be used in your Route.

Procedure

  1. In your Route, double-click the cMap component.
  2. In the first step of the wizard that opens, select your input structure and click Next.
  3. In the second step, select your output structure and click Finish.
    A map is generated and opens in the editor. You can now configure it.
  4. Drag the input orders element on the output orders element.
    All elements in the input are automatically mapped with the corresponding elements in the output.
  5. From the Functions tab, drag and drop a Multiply function on the itemTotal element.
  6. Drag and drop the output price element on the First Value argument and the output quantity element on Second Value.
  7. Drag and drop an AgSum function on the orderTotal element, then drag and drop the itemTotal element on the AgSum function.
  8. Drag and drop a GetValueFromExternalMap function on the orderDate element, drag and drop a Constant function on the Key argument, then double-click the Constant function and enter current.date in the Value field.
    This configuration allows you to retrieve the value from the variable you created in the first cProcessor component of your Route.
  9. Drag and drop an AddToDateTime function on the shippingDueDate element, double-click the function and select Days in the Add what? drop-down list.
  10. Drag and drop a Constant function on the Amount argument and set its value to 5.
  11. Drag and drop the output orderDate element on the DateTime Value argument.
  12. Open the Util tab of the shippingDueDate element and drag and drop a PutValueToExternalMap function in it.
  13. Drag and drop a Constant function on the Key argument and set its value to due.date.
  14. Drag and drop the shippingDueDate element on the Value argument.

    This allows you to create an external map variable named due.date with the value of the shippingDueDate element.

  15. Click the output orderId element, open its Util tab and repeat the previous steps to create a variable named order.id.
  16. Save your map.

Results

Your map is now configured. You can run your Route to see the result. In this example, the result looks like this:

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!