> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Simplifying DB2API Result

> You can simplify results returned from DB2API using JOLT, clean unnecessary fields, and reorganize data structure. This page includes examples of changing the name of the data element and moving specific fields to upper level.

Result value returned from DB2API:

```
{
  "statusCode" : 200,
  "statusDescription" : "OK",
  "columnNames" : [ "customerNumber", "customerName", "contactLastName", "contactFirstName", "phone", "addressLine1", "addressLine2", "city", "state", "postalCode", "country", "salesRepEmployeeNumber", "creditLimit" ],
  "numRows" : 2,
  "data" : [ {
    "country" : "France",
    "city" : "Nantes",
    "contactFirstName" : "Carine ",
    "postalCode" : "44000",
    "salesRepEmployeeNumber" : 1370,
    "customerNumber" : 103,
    "customerName" : "Atelier graphique",
    "phone" : "40.32.2555",
    "addressLine1" : "54, rue Royale",
    "creditLimit" : 21000.0,
    "contactLastName" : "Schmitt",
    "addressLine2" : null,
    "state" : null
  }, {
    "country" : "France",
    "city" : "Nantes",
    "contactFirstName" : "Janine ",
    "postalCode" : "44000",
    "salesRepEmployeeNumber" : 1370,
    "customerNumber" : 119,
    "customerName" : "La Rochelle Gifts",
    "phone" : "40.67.8555",
    "addressLine1" : "67, rue des Cinquante Otages",
    "creditLimit" : 118200.0,
    "contactLastName" : "Labrune",
    "addressLine2" : null,
    "state" : null
  } ],
  "elapsedTime" : 11,
  "errors" : [ ]
}  
 
```

* JOLT example and output that **changes the name** of the "data" element and **cleans** it from other elements:

```
-------------------------------------------
JOLT: 
--------------------------------------------  

[
  {
    "operation": "shift",
    "spec": {
          "data":"sonuç"
     }
  }
]

--------------------------------------------
RESULT
--------------------------------------------  
{
  "sonuç" : [ {
    "country" : "France",
    "city" : "Nantes",
    "contactFirstName" : "Carine ",
    "postalCode" : "44000",
    "salesRepEmployeeNumber" : 1370,
    "customerNumber" : 103,
    "customerName" : "Atelier graphique",
    "phone" : "40.32.2555",
    "addressLine1" : "54, rue Royale",
    "creditLimit" : 21000.0,
    "contactLastName" : "Schmitt",
    "addressLine2" : null,
    "state" : null
  }, {
    "country" : "France",
    "city" : "Nantes",
    "contactFirstName" : "Janine ",
    "postalCode" : "44000",
    "salesRepEmployeeNumber" : 1370,
    "customerNumber" : 119,
    "customerName" : "La Rochelle Gifts",
    "phone" : "40.67.8555",
    "addressLine1" : "67, rue des Cinquante Otages",
    "creditLimit" : 118200.0,
    "contactLastName" : "Labrune",
    "addressLine2" : null,
    "state" : null
  } ]
}

 
```

* JOLT example and output that **moves** "country" **elements** within the "data" element **to one level up** and **cleans** it from other elements:

```
-------------------------------------------
JOLT:
-------------------------------------------

[
  {
    "operation": "shift",
    "spec": {
      "data": {
        "*": {
          "country": "&"
        }
      }
    }
  }
]

 
--------------------------------------------
RESULT
--------------------------------------------  

{
  "country": [
    "France",
    "France"
  ]
}
```

* JOLT example and output that **moves the value** of "country" **elements** within the "data" element **to one level up** and **cleans** it from other elements:

```
-------------------------------------------
JOLT:
-------------------------------------------

[
  {
    "operation": "shift",
    "spec": {
      "data": {
        "*": {
          "country": "[&1]."
        }
      }
    }
  }
]

 
--------------------------------------------
RESULT
--------------------------------------------  

[
  "France",
  "France"
]
```
