Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago

CSV from a website to Bi

Hello! 

I have an intranet website that has a button to download a file in CSV. 

Is it possible to trigger this function in the website to fetch the CSV file and transform it into a table? If it is doable what info you might need from me to help me? please let me know, thanks. 

3 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    It depends. When you hover over the button (or press it), do you see a URL that gives the full path to the file (i.e., ends in .csv)? If so, you can probably use that path in the Web.Contents( ) function to scrape the file from the site.

     

    Here is an example url that works in Web.Contents( )

    https://people.sc.fsu.edu/~jburkardt/data/csv/addresses.csv

     

    Pat

     

    • jbwtp's avatar
      jbwtp
      Memorable Member

      Hi Syndicate_Admin,

       

      Based on my experience, fetching files by immitating HTTP request sent by a button on intranet is at least painful even if possible at all as it involves setting up request details which are not simple to get in PQ. After all this is data manipulation, not general purpose language.

       

      Try what mahoneypat suggested, but buttons are rarely contain address of the file, I would imagine that this is some end-point trigger address for sending the file back over HTTP.

       

      It may be simpler if you could find out (from your IT team, I guess) where is the file stored andif you can have access to this location and then use a conventional connector to get the data.

       

      If this is not an option, you can play with the Developer functionality of your Internet browser (I am sure this can be summoned by F12 button on both Edge and Chrome). There is a section relating to network calls. You can try to trace what is happening when you pressing the button there and try to replicate the setting in the Web.Content (search on Internet how to set headers, etc.).

       

      Kind regards,

      John

  • Hi Syndicate_Admin ,

    Is your problem solved? If so, would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirment will find the solution quickly and benefit here, thank you!

    Best Regards,
    Community Support Team _ kalyj