Question: I want to convert the following JSON using JsonObect and `JsonArray` but not able to do so.

```
{
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "customer.partnerName": "Synapse"
          }
        },
        {
          "range": {
            "customer.billing.chargeAmount": {
              "gte": 1,
              "lte": 100
            }
          }
        }
      ],
      "filter": [
        {
          "match": {
            "customer.configId": 15
          }
        }
      ]
    }
  }
}

```

I have tried using `JsonObject` but not able to achieve the result.

Answer: 
To create a new row, you need to call [`insertNewRowBefore()`](https://phpoffice.github.io/PhpSpreadsheet/master/PhpOffice/PhpSpreadsheet/Worksheet/Worksheet.html#method_insertNewRowBefore) with the row number you want to insert before...

```
$sheet = $spreadsheet->getActiveSheet();
$sheet->insertNewRowBefore(1);
$sheet->setCellValue('A1', 'Updated');

```

You can also call it with a number of rows to insert, the default is 1.

If you want to append a row, you can call `getHighestRow()` to find the last row and add 1 to it for the new row. Also change the hard coding of the column in the `setCellValue()` call to use this row as well...

```
$sheet = $spreadsheet->getActiveSheet();
$row = $sheet->getHighestRow()+1;
$sheet->insertNewRowBefore($row);
$sheet->setCellValue('A'.$row, 'Updated');

```
Hello I think this issue came because of memory exhausted so increase your memory limit by php.ini file 

like memory\_limit = 256M 

After increase memory limit , restart your apache