Contact Us 1-800-596-4880

Use Constant Directives

This DataWeave example builds URLs from constants that are defined as variables (var) in the DataWeave header. It also conditionally outputs fields if they are present in the input.

The example uses these functions:

  • ++ (concatenate) to build constant directives into URLs.

  • map to go through the fields in the input.

  • if to output summary and brand fields.

DataWeave Script:
Input XML Payload:
Output JSON: