<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I capture the products from a shopping cart if it has 2 or more products selected, from the json with grail in DQL</title>
    <link>https://community.dynatrace.com/t5/DQL/How-can-I-capture-the-products-from-a-shopping-cart-if-it-has-2/m-p/241786#M802</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/61528"&gt;@dff&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You must have to use JSON_ARRAY instead of JSON, and then expand the rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(productos="""[
    {
      "nombre": "Basic Blue Jeans",
      "cantidad": 2,
      "precio_unitario": 30
    },
    {
      "nombre": "DNK Purple tshirt",
      "cantidad": 3,
      "precio_unitario": 45
    }
  ]""",orderNumber="2660", totalPedido=1500)
| filter orderNumber=="2660"
| parse productos,"JSON_ARRAY:json"
| expand json
| fieldsAdd nombre = json[nombre], cantidad = json[cantidad], precio_unitario = json[precio_unitario] ,totalPedido,orderNumber
| fields productos,nombre, orderNumber, totalPedido, cantidad, precio_unitario&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cesarsaravia_0-1712176169210.png" style="width: 858px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18675iF413A9657A143FBC/image-dimensions/858x268?v=v2" width="858" height="268" role="button" title="cesarsaravia_0-1712176169210.png" alt="cesarsaravia_0-1712176169210.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 20:42:58 GMT</pubDate>
    <dc:creator>cesarsaravia</dc:creator>
    <dc:date>2024-04-03T20:42:58Z</dc:date>
    <item>
      <title>How can I capture the products from a shopping cart if it has 2 or more products selected, from the json with grail</title>
      <link>https://community.dynatrace.com/t5/DQL/How-can-I-capture-the-products-from-a-shopping-cart-if-it-has-2/m-p/241779#M801</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hello, I have a concern.&lt;/P&gt;
&lt;P&gt;I have the following Quuery. Which the product field brings in json, but separating it only allows me from the first block only&lt;/P&gt;
&lt;P&gt;The idea is that I separate them into 2 or 3 results depending on the number of products that the json brings&lt;BR /&gt;&lt;BR /&gt;attached query&lt;BR /&gt;&lt;BR /&gt;fetch bizevents , from:now()-1h, to:now()&lt;BR /&gt;| filter event.type=="portalcmo.fyags.com/wpcmo"&lt;BR /&gt;| filter orderNumber=="2660"&lt;BR /&gt;| parse productos, "DATA json:json"&lt;BR /&gt;| fieldsAdd nombre = json[nombre], cantidad = json[cantidad], precio_unitario = json[precio_unitario] ,totalPedido,orderNumber&lt;BR /&gt;| fields productos,nombre, orderNumber&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dff_0-1712173704777.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18671iB89BFEF8BA95584B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dff_0-1712173704777.png" alt="dff_0-1712173704777.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The idea is:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which the 2 products correspond to the same order&lt;BR /&gt;nombre&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Order&amp;nbsp;&lt;BR /&gt;Product1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1234&lt;/P&gt;
&lt;P&gt;product2&amp;nbsp; &amp;nbsp; &amp;nbsp; 1234&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 08:04:15 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-can-I-capture-the-products-from-a-shopping-cart-if-it-has-2/m-p/241779#M801</guid>
      <dc:creator>dff</dc:creator>
      <dc:date>2024-04-04T08:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I capture the products from a shopping cart if it has 2 or more products selected, from the json with grail</title>
      <link>https://community.dynatrace.com/t5/DQL/How-can-I-capture-the-products-from-a-shopping-cart-if-it-has-2/m-p/241786#M802</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/61528"&gt;@dff&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You must have to use JSON_ARRAY instead of JSON, and then expand the rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;data record(productos="""[
    {
      "nombre": "Basic Blue Jeans",
      "cantidad": 2,
      "precio_unitario": 30
    },
    {
      "nombre": "DNK Purple tshirt",
      "cantidad": 3,
      "precio_unitario": 45
    }
  ]""",orderNumber="2660", totalPedido=1500)
| filter orderNumber=="2660"
| parse productos,"JSON_ARRAY:json"
| expand json
| fieldsAdd nombre = json[nombre], cantidad = json[cantidad], precio_unitario = json[precio_unitario] ,totalPedido,orderNumber
| fields productos,nombre, orderNumber, totalPedido, cantidad, precio_unitario&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cesarsaravia_0-1712176169210.png" style="width: 858px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/18675iF413A9657A143FBC/image-dimensions/858x268?v=v2" width="858" height="268" role="button" title="cesarsaravia_0-1712176169210.png" alt="cesarsaravia_0-1712176169210.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 20:42:58 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/DQL/How-can-I-capture-the-products-from-a-shopping-cart-if-it-has-2/m-p/241786#M802</guid>
      <dc:creator>cesarsaravia</dc:creator>
      <dc:date>2024-04-03T20:42:58Z</dc:date>
    </item>
  </channel>
</rss>

