Forum Discussion

kylechapin's avatar
kylechapin
Frequent Visitor
8 years ago

streaming dataset API

Hello,

 

I am trying to create a streaming dataset to receive PUSH notifications from our E-Commerce site.  I can create a webhook and use the URL that is provided when creating a streaming dataset.  

However, I need to put in each and every item line by line.  The JSON that is pushed is very large and would take a long time to input.  Also, the JSON I'm working with has line items within line items... Its not a simple JSON file 

 

I can see the JSON code preview below, but I can't change except by adding another line item.

Is there a way to copy/paste the JSON structure?

8 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    kylechapin wrote:

    Hello,

     

    I am trying to create a streaming dataset to receive PUSH notifications from our E-Commerce site.  I can create a webhook and use the URL that is provided when creating a streaming dataset.  

    However, I need to put in each and every item line by line.  The JSON that is pushed is very large and would take a long time to input.  Also, the JSON I'm working with has line items within line items... Its not a simple JSON file 

     

    I can see the JSON code preview below, but I can't change except by adding another line item.

    Is there a way to copy/paste the JSON structure?


    kylechapin

    I don't quite get your question. Are you trying to push data from one JSON file to Power BI streaming dataset so that you need to compose the Power BI Streaming dataset JSON which is in pretty different JSON structure from your JSON file? If so, your question is actually beyond the topic of this forum. As to how to parse one JSON to a required structure, I'd suggest you post it in the stackoverflow forum. The required JSON struture in Power BI streaming dataset is usually as below, the names and numbers of the fields depend on the specific dataset you created.

    [
    {
    "Product" :"Product1",
    "Sales" :98.6,
    "Time" :"2017-10-23T08:55:45.961Z"
    }
    ,
    {
    "Product" :"Product2",
    "Sales" :98.6,
    "Time" :"2017-10-23T08:55:45.961Z"
    }
    ]
    • kylechapin's avatar
      kylechapin
      Frequent Visitor

      Hi Erik,

       

      Thanks for your reply and I'm sorry if I was unclear.  I tried uploading a screenshot.. but couldn't.  

       

      Here is an example of the JSON I need to upload:

      [
      {
      "order_number":"12345",
      "billing_address": {"first_name":"Bob","address1":"123 Billing Street","phone":"555-555-BILL","city":"Billtown","zip":"K2P0B0"},
      "total_order_amount":"29.99"
      }
      ]

       

      But I can only seem to get this:

      [
      {
      "order_number":"12345",
      "billing_address": "some address",
      "total_order_amount":"29.99"
      }
      ]

       

      How do I get the part in red to be included in the JSON I set up in Power BI?

       

       

      • Eric_Zhang's avatar
        Eric_Zhang
        Microsoft Employee

        kylechapin wrote:

        Hi Erik,

         

        Thanks for your reply and I'm sorry if I was unclear.  I tried uploading a screenshot.. but couldn't.  

         

        Here is an example of the JSON I need to upload:

        [
        {
        "order_number":"12345",
        "billing_address": {"first_name":"Bob","address1":"123 Billing Street","phone":"555-555-BILL","city":"Billtown","zip":"K2P0B0"},
        "total_order_amount":"29.99"
        }
        ]

         

        But I can only seem to get this:

        [
        {
        "order_number":"12345",
        "billing_address": "some address",
        "total_order_amount":"29.99"
        }
        ]

         

        How do I get the part in red to be included in the JSON I set up in Power BI?

         

         


        kylechapin

        So the column billing_address can be a JSON string as posted? If so, you could try

        [
        {
        "order_number":"12345",
        "billing_address":"{\"first_name\":\"Bob\",\"address1\":\"123 Billing Street\",\"phone\":\"555-555-BILL\",\"city\":\"Billtown\",\"zip\":\"K2P0B0\"}",  
        "total_order_amount":"29.99"
        }
        ]