Forum Discussion

Markzolotoy's avatar
Markzolotoy
Impactful Individual
10 years ago

Get data from webservice

I am trying to bring data into my dashboard by accessing a websevice endpoint. It works fine in my mobile report wher i am using a dataset based on an xml data source. After proving URL of that data source I get the following screen:

After Loading it I dont see any data. 

 

Any idea?

 

Thanks

20 Replies

    • Markzolotoy's avatar
      Markzolotoy
      Impactful Individual

      When I choose XML as a data source it prompts me to seldect a file, but I want to get it from the webservice.

      • v-qiuyu-msft's avatar
        v-qiuyu-msft
        Community Support

        Hi Markzolotoy,

         

        You can see when you use web data source to get data, you just need to place the URL and extract records from the dataset. But in your scenario, the extracted records don't contain any fact data. So it's not a good option to use web data source if you want to get fact data.

         

        Best Regards,
        Qiuyun Yu

    • Markzolotoy's avatar
      Markzolotoy
      Impactful Individual

      Ok, first I get this:

      After Edit I get this:

       

       

       

       

       

      Then I click on Table and get this:

       

       

       

       

       

       

      Then I click on Table again and get this:

       

       

       

       

       

      At this point nothing to click on. 

       

      Any more ideas?

  • Youssef's avatar
    Youssef
    Microsoft Employee

    You should be able to connect to Restful Web Services that return valid Json using the GetData from Web in Power BI Desktop.

     

    From the screenshot, it seems that what returns from the URL you put is not Json but HTML. You can monitor the traffic with Fiddler and make sure what's coming back is actual json.

     

    Hope this helps.

    • Markzolotoy's avatar
      Markzolotoy
      Impactful Individual

      Do I need to change my data source after it's been created to say Json? By default it says HTML.

       

       

       

       

       

       

       

      But the reason I am not gettng json id because my webservice is not returning pure json?

      • Youssef's avatar
        Youssef
        Microsoft Employee

        What is the data type you are expecting from your webservice end point? Is it Json? If so, they Power BI should perfectly support this scenario. Let me know if that's the case and you are still facing issues.

         

        If the data you are expecting is HTML data like a web page, you can refer to the articly linked in one of the replies above on more details on that. You might have to do some parsing and cleaning up in this case.

  • I'm relatively new to PowerBI and powerQuery, and maybe you have had this problem sorted out allready, but it seems like you have drawn data from an url without formatting it as xml data. I guess you have use a formula like:

     

    Source = Web.Contents(https://some.url.here)

    Which by default will return a HTML file. Try to wrap the web-connector in an XML formula like this:

     

    Source = Xml.Tables(Web.Contents(https://some.url.here))

    And I guess you will be fine

  • I'm relatively new to PowerBI and powerQuery, and maybe you have had this problem sorted out allready, but it seems like you have drawn data from an url without formatting it as xml data. I guess you have use a formula like:

     

    Source = Web.Contents(https://some.url.here)

    Which by default will return a HTML file. Try to wrap the web-connector in an XML formula like this:

     

    Source = Xml.Tables(Web.Contents(https://some.url.here))

    And I guess you will be fine

      • karekaasamoen's avatar
        karekaasamoen
        Frequent Visitor

        The best way is to use the advanced query editor. From the analysis-model (main window), click the Edit Queries button

         

        Then, right-click the actual datasource and select advanced editor

         

         

        I guess the source of your data looks quite similar to this Source = ( Web.Page(Web.Contents(....)

         

         

        Change this to Xml.Tables(Web.Contents and I guess you will have your data as expected. The advanced editor uses PowerQuery scripting language, is flexible and gives a lot of opportunities, but if you haven't used this you have a certain learning curve. But try it out