<?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: Need help publishing Javascript data to Streaming Dashboard in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-publishing-Javascript-data-to-Streaming-Dashboard/m-p/621393#M18535</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you store the values somewhere? If not, I would suggest you use JS to push the data into Power BI. Please refer to the demo below.&lt;/P&gt;
&lt;P&gt;1. Install Node.js.&lt;/P&gt;
&lt;P&gt;2. Install the&amp;nbsp;module "request".&lt;/P&gt;
&lt;P&gt;3. Try the code below.&lt;/P&gt;
&lt;PRE&gt;var request = require('request');


// the URL of Power BI streaming dataset.
var target_url = "https://api.powerbi.com/beta/*************************g%3D%3D"
// the data to push. It should be the values generated by JS to you.
var raw_data = {'ID': 1999, 'Name': "Jack"}
// convert a object to JSON.
var data_to_post = JSON.stringify(raw_data)


const req = request.post(target_url, data_to_post, (error, res, body) =&amp;gt; {
    console.log(`Status code: ${res.statusCode}`);
});

req.on('error', (e) =&amp;gt; {
    console.log("error: " + e.message);
});

req.write(data_to_post);
req.end;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://ibb.co/gP9y1ZM" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/e8b1fafd9c607613974c85e090bc4a6940edbd02/68747470733a2f2f692e6962622e636f2f487834377654442f4e6565642d68656c702d7075626c697368696e672d4a6176617363726970742d646174612d746f2d53747265616d696e672d44617368626f6172642e706e67" border="0" alt="Need-help-publishing-Javascript-data-to-Streaming-Dashboard" /&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2019 07:15:23 GMT</pubDate>
    <dc:creator>v-jiascu-msft</dc:creator>
    <dc:date>2019-02-12T07:15:23Z</dc:date>
    <item>
      <title>Need help publishing Javascript data to Streaming Dashboard</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-publishing-Javascript-data-to-Streaming-Dashboard/m-p/620770#M18527</link>
      <description>&lt;P&gt;I am trying to create an example of a streaming dashboard in Power BI using a javascript random number generator with a date stamp. I have created the Javascript to get the values I need, but I don't&amp;nbsp;know how to use the URL or cURL or Powershell to publish the fake data my Javascript is producing. Any help would be greatly appreciated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 15:16:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-publishing-Javascript-data-to-Streaming-Dashboard/m-p/620770#M18527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-02-11T15:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need help publishing Javascript data to Streaming Dashboard</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-publishing-Javascript-data-to-Streaming-Dashboard/m-p/621393#M18535</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you store the values somewhere? If not, I would suggest you use JS to push the data into Power BI. Please refer to the demo below.&lt;/P&gt;
&lt;P&gt;1. Install Node.js.&lt;/P&gt;
&lt;P&gt;2. Install the&amp;nbsp;module "request".&lt;/P&gt;
&lt;P&gt;3. Try the code below.&lt;/P&gt;
&lt;PRE&gt;var request = require('request');


// the URL of Power BI streaming dataset.
var target_url = "https://api.powerbi.com/beta/*************************g%3D%3D"
// the data to push. It should be the values generated by JS to you.
var raw_data = {'ID': 1999, 'Name': "Jack"}
// convert a object to JSON.
var data_to_post = JSON.stringify(raw_data)


const req = request.post(target_url, data_to_post, (error, res, body) =&amp;gt; {
    console.log(`Status code: ${res.statusCode}`);
});

req.on('error', (e) =&amp;gt; {
    console.log("error: " + e.message);
});

req.write(data_to_post);
req.end;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://ibb.co/gP9y1ZM" target="_blank"&gt;&lt;IMG src="https://ip1.i.lithium.com/e8b1fafd9c607613974c85e090bc4a6940edbd02/68747470733a2f2f692e6962622e636f2f487834377654442f4e6565642d68656c702d7075626c697368696e672d4a6176617363726970742d646174612d746f2d53747265616d696e672d44617368626f6172642e706e67" border="0" alt="Need-help-publishing-Javascript-data-to-Streaming-Dashboard" /&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 07:15:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-publishing-Javascript-data-to-Streaming-Dashboard/m-p/621393#M18535</guid>
      <dc:creator>v-jiascu-msft</dc:creator>
      <dc:date>2019-02-12T07:15:23Z</dc:date>
    </item>
  </channel>
</rss>

