title: JSON Object in Azure Logic Apps
body: <p>Someone please help.</p>
  <p>We receive orders in different formats and convert to JSON for processing and transformation to our API.</p>
  <p>Please see example:</p>
  <pre class="lang-json prettyprint-override"><code>[
    {
      &quot;Order Number&quot;: &quot;10188&quot;,
      &quot;Order Date&quot;: &quot;05/06/2021&quot;,
      &quot;SKU&quot;: &quot;LW80S&quot;,
      &quot;Quantity&quot;: &quot;3&quot;
    },
    {
      &quot;Order Number&quot;: &quot;10187&quot;,
      &quot;Order Date&quot;: &quot;05/06/2021&quot;,
      &quot;SKU&quot;: &quot;LW90L&quot;,
      &quot;Quantity&quot;: &quot;1&quot;
    },
    {
      &quot;Order Number&quot;: &quot;10187&quot;,
      &quot;Order Date&quot;: &quot;05/06/2021&quot;,
      &quot;SKU&quot;: &quot;LW80S&quot;,
      &quot;Quantity&quot;: &quot;1&quot;
    },
    {
      &quot;Order Number&quot;: &quot;10187&quot;,
      &quot;Order Date&quot;: &quot;05/06/2021&quot;,
      &quot;SKU&quot;: &quot;CCDW12&quot;,
      &quot;Quantity&quot;: &quot;1&quot;
    },
    {
      &quot;Order Number&quot;: &quot;10187&quot;,
      &quot;Order Date&quot;: &quot;05/06/2021&quot;,
      &quot;SKU&quot;: &quot;CSS&quot;,
      &quot;Quantity&quot;: &quot;1&quot;
    }
  ]
  </code></pre>
  <p>As you can see as there multiple lines for the same order &quot;10187&quot; the conversion to JSON has created multiple objects.</p>
  <p>So I need to take the output above and transform to the below:</p>
  <pre class="lang-json prettyprint-override"><code>&quot;Order&quot;: {
        &quot;OrderNumber&quot;: &quot;10187&quot;,
        &quot;TotalUnits&quot;: &quot;4&quot;,
        &quot;OrderLine&quot;: [
           {
              &quot;OrderedQty&quot;: &quot;1&quot;,
              &quot;Product&quot;: &quot;LW90L&quot;,
           },
                    {
              &quot;OrderedQty&quot;: &quot;1&quot;,
              &quot;Product&quot;: &quot;LW80S&quot;,
           },
                    {
              &quot;OrderedQty&quot;: &quot;1&quot;,
              &quot;Product&quot;: &quot;CCDW12&quot;,
           },
          {
              &quot;OrderedQty&quot;: &quot;1&quot;,
              &quot;Product&quot;: &quot;CSS&quot;,
           }
        ]
        }
  </code></pre>
  <p>So it is grouped by order number. Can you please advise how I can achieve?</p>