Skip to main content Skip to complementary content

Mapping enumerated values in a DSQL map

Map enumerated values from an input structure to different enumerated values in an output structure.

Before you begin

You have created structures with enumerated values.

About this task

This example uses the input data and structures created in Mapping fixed sets of values.

Procedure

  1. Create a DSQL 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 each input value for tier under the corresponding output value for status:
    • One to Platinum
    • Two to Gold
    • Three to Silver
    Information noteTip: If the input and output enumerated values are identical, you can simply drag and drop the input element on the output element to map all enumerated values.

Results

A SWITCH clause is automatically created in the expression editor for the status element:
SWITCH (tier) {
   CASE 'One' : 'Platinum'
   CASE 'Two' : 'Gold'
   CASE 'Three' : 'Silver'
}
The map is configured, you can click Test Run to see the result. In this example, this is the output:
{
   "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!