<?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: Power bi REST API for datasets to add rows in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-bi-REST-API-for-datasets-to-add-rows/m-p/443635#M13678</link>
    <description>&lt;P&gt;Issue solved :&amp;nbsp;&lt;/P&gt;&lt;P&gt;var options = {&lt;BR /&gt;method: 'POST',&lt;BR /&gt;url: '&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/&lt;/A&gt;' + app.locals.POWERBI_GROUP +'/datasets',&lt;BR /&gt;headers:&lt;BR /&gt;{&lt;BR /&gt;'Cache-Control': 'no-cache',&lt;BR /&gt;'Authorization': 'Bearer ' + req.session.access_token,&lt;BR /&gt;'Content-Type': 'application/json'&lt;BR /&gt;},&lt;BR /&gt;body:&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;: 'Monthly Data',&lt;BR /&gt;&lt;STRONG&gt;defaultMode&lt;/STRONG&gt;: 'Push',&lt;BR /&gt;&lt;STRONG&gt;tables&lt;/STRONG&gt;:&lt;BR /&gt;[{&lt;BR /&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;: 'July-2018',&lt;BR /&gt;&lt;STRONG&gt;columns&lt;/STRONG&gt;:&lt;BR /&gt;[{ name: 'ProductID', dataType: 'Int64' },&lt;BR /&gt;{ name: 'Name', dataType: 'string' },&lt;BR /&gt;{ name: 'Category', dataType: 'string' },&lt;BR /&gt;{ name: 'IsCompete', dataType: 'bool' },&lt;BR /&gt;{ name: 'ManufacturedOn', dataType: 'DateTime' }]&lt;BR /&gt;}]&lt;BR /&gt;},&lt;BR /&gt;//json: true&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I was missing , remove double quotes&amp;nbsp; "" which is bold in above code&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jun 2018 20:56:35 GMT</pubDate>
    <dc:creator>rupali</dc:creator>
    <dc:date>2018-06-19T20:56:35Z</dc:date>
    <item>
      <title>Power bi REST API for datasets to add rows</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-bi-REST-API-for-datasets-to-add-rows/m-p/442139#M13636</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I have power bi Pro&lt;/STRONG&gt; , I am following all documentation to GET /POST /PUT method for datasets and reports in groups.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can embedded reports succesfully in my App using power bi API . And even I am&lt;U&gt; getting datasets ids.&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;POWER BI REST API&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q: How to add rows in dataset in Group? ( I have documentation link&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_postrowsingroup" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_postrowsingroup&lt;/A&gt; -&amp;nbsp; but before rows i need tables)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now , I am trying to GET tables ,following below documentation:&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_gettablesingroup" target="_blank"&gt;https://docs.microsoft.com/en-us/rest/api/power-bi/pushdatasets/datasets_gettablesingroup&lt;/A&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;But , not getting tables.&lt;/P&gt;&lt;P&gt;Then I read in solution that we need to create dataset in app , then only we can create tables and add row in it . I tried this option too , but still not getting succes yet .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This is my code :&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;// for specific dataset with POST method(to crate dataset)
app.get("/dataset", [ensureAuthenticated, generatePBIAccessToken], function (req, res) {
    var data = req.query;
    data.user = req.user;
    var options = {
        method: 'POST',
        url: 'https://api.powerbi.com/v1.0/myorg/groups/' + app.locals.POWERBI_GROUP + '/datasets' ,
        headers: {
            'cache-control': 'no-cache',
            'authorization': 'Bearer ' + req.session.access_token,
            'content-type': 'application/x-www-form-urlencoded',
            'accepts': 'application/json',
            'charset': 'utf - 8',
            'request': 'System.Net.WebRequest.Create(powerBIDatasetsApiUrl) as System.Net.HttpWebRequest'
        },
        form: {
            "accessLevel": "View",
            "datasetId": req.query.datasetid,
            "allowSaveAs": true
        },
       body: {
           "name": "SalesMarketing",
           "defaultMode": "Push",
           "tables": [
               {
                   "name": "Product",
                   "columns": [
                       {
                           "name": "ProductID",
                           "dataType": "Int64"
                       },
                       {
                           "name": "Name",
                           "dataType": "string"
                       },
                       {
                           "name": "Category",
                           "dataType": "string"
                       },
                       {
                           "name": "IsCompete",
                           "dataType": "bool"
                       },
                       {
                           "name": "ManufacturedOn",
                           "dataType": "DateTime"
                       }
                   ]
               }
           ]
        } 
    };

    console.log("************************************ for datasetkeys");
    console.log(options);
    
    console.log("To create dataset  specific dataset with POST method");
    
    console.log("************************************");
    request(options, function (error, response, body) {
        if (error) throw new Error(error);
        data.embed = JSON.parse(body);
        res.render('pbi-dataset', data);
        
    });
});&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and This is&amp;nbsp; output for above code :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tables.PNG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/101786iD7A25658661FB9E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="tables.PNG" alt="tables.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I am missing ?&amp;nbsp; Please suggest thank in advance .&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 13:43:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-bi-REST-API-for-datasets-to-add-rows/m-p/442139#M13636</guid>
      <dc:creator>rupali</dc:creator>
      <dc:date>2018-06-18T13:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Power bi REST API for datasets to add rows</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-bi-REST-API-for-datasets-to-add-rows/m-p/443635#M13678</link>
      <description>&lt;P&gt;Issue solved :&amp;nbsp;&lt;/P&gt;&lt;P&gt;var options = {&lt;BR /&gt;method: 'POST',&lt;BR /&gt;url: '&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/" target="_blank"&gt;https://api.powerbi.com/v1.0/myorg/groups/&lt;/A&gt;' + app.locals.POWERBI_GROUP +'/datasets',&lt;BR /&gt;headers:&lt;BR /&gt;{&lt;BR /&gt;'Cache-Control': 'no-cache',&lt;BR /&gt;'Authorization': 'Bearer ' + req.session.access_token,&lt;BR /&gt;'Content-Type': 'application/json'&lt;BR /&gt;},&lt;BR /&gt;body:&lt;BR /&gt;{&lt;BR /&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;: 'Monthly Data',&lt;BR /&gt;&lt;STRONG&gt;defaultMode&lt;/STRONG&gt;: 'Push',&lt;BR /&gt;&lt;STRONG&gt;tables&lt;/STRONG&gt;:&lt;BR /&gt;[{&lt;BR /&gt;&lt;STRONG&gt;name&lt;/STRONG&gt;: 'July-2018',&lt;BR /&gt;&lt;STRONG&gt;columns&lt;/STRONG&gt;:&lt;BR /&gt;[{ name: 'ProductID', dataType: 'Int64' },&lt;BR /&gt;{ name: 'Name', dataType: 'string' },&lt;BR /&gt;{ name: 'Category', dataType: 'string' },&lt;BR /&gt;{ name: 'IsCompete', dataType: 'bool' },&lt;BR /&gt;{ name: 'ManufacturedOn', dataType: 'DateTime' }]&lt;BR /&gt;}]&lt;BR /&gt;},&lt;BR /&gt;//json: true&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I was missing , remove double quotes&amp;nbsp; "" which is bold in above code&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 20:56:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-bi-REST-API-for-datasets-to-add-rows/m-p/443635#M13678</guid>
      <dc:creator>rupali</dc:creator>
      <dc:date>2018-06-19T20:56:35Z</dc:date>
    </item>
  </channel>
</rss>

