Skip to main content Skip to complementary content

Creating a map with enumerated values

Map the structures created previously, and use the MapValues function to map the enumerated values.

Procedure

  1. Create a new map and add your input and output structures.
  2. Drag and drop the input id and name elements on the corresponding output elements.
  3. Drag and drop a MapValues function on the output status element.
  4. Drag and drop the input tier element on the Source Map Element argument under the MapValues.
  5. Double-click the MapValues function to open the expression properties.
  6. Drag and drop the input values to the output values:
    • One to Platinum
    • Two to Gold
    • Three to Silver
  7. Click OK.

Results

A new ValueMapping function is added to match each input value to the corresponding output value. The map is done, you can click Test Run to see the result. In this example, the following result is returned:
{
    "customers": [
        {
            "id": "abc-123",
            "name": "John Doe",
            "status": "Gold"
        },
        {
            "id": "def-456",
            "name": "Jane Smith",
            "status": "Platinum"
        },
        {
            "id": "ghi-789",
            "name": "Emily Stone",
            "status": "Silver"
        }
    ]
}

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 – please let us know!