Skip to main content Skip to complementary content
Close announcements banner

Updating a structure used in a map

Add and rename elements in a structure used as output in a map.

About this task

In this example, you want to edit the output structure in the map created in Creating a DSQL map to add a new element and rename an existing one. This example uses a DSQL map, but this procedure also applies to standard maps.

Procedure

  1. Open your map, and click the hyperlink under the output structure to open it in the structure editor.
  2. Right-click the items element and click New Element.
  3. Enter the name of the new element, color in this example, and press Enter.
  4. Save the structure.
  5. Go back to your map.
    The new element appears in the output structure, you can map it with the corresponding input element.
  6. Go back to the output structure editor and click the make element, then click Read Only and select Editable.
  7. In the Name field, replace make with model and save the structure.
  8. Go back to your map.
    The make element appears as deleted, while the model element is added as a new element. You can now update the map to use the new element.
  9. Click the make element to open its expression editor and copy the expression.
  10. Click the model element and paste the expression from make in the expression editor.
  11. Right-click the make element and click Delete Invalid Element(s).

Results

The structure and map are updated. If you use the Test Run, this example should return the following result:
{
   "items":[
      {
         "model":"MBIKE",
         "description":"27.5 inch electric mountain bike",
         "price":"899.99 USD",
         "color":"blue"
      },
      {
         "model":"EBIKE",
         "description":"Electric hybrid bike",
         "price":"999.99 USD",
         "color":"grey/green"
      },
      {
         "model":"WBIKE",
         "description":"Women's road bike",
         "price":"299.99 USD",
         "color":"white"
      }
   ]
}

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!