Forum

Power Query doesnt ...
 
Notifications
Clear all

Power Query doesnt read from url address

7 Posts
2 Users
0 Reactions
107 Views
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

hi Guys,

i have glassfish java server and retriving csvs from there.

the url is like:

http://localhost:8080/BundleService-1.0.0/ v1/bundles/Master/data/name:excel%2Fderived/1.0.0/TabName/TabName

When i am inputting in Chrome - eveything is working fine. 
But when i am trying to use Power Query, i am getting SourceData Error.

How to get to this link with %2F sign?

Please help,
Jacek

 
Posted : 16/02/2021 7:21 am
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Hi,

 

what i tried in advance editor is:

let
Source = Csv.Document(Web.Contents("http://localhost:8080/BundleService-1.0.0/v1/bundles/Master/data/name:excel" & Uri.EscapeDataString("/") & "derived/1.0.0/TabName/TabName"),[Delimiter=",", Columns=15, Encoding=1250, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers"= Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"

but still i have error....

Please help,
Jacek

 
Posted : 17/02/2021 6:10 am
(@catalinb)
Posts: 1937
Member Admin
 

Try to encode the entire string:
Uri.EscapeDataString("http://localhost:8080/BundleService-1.0.0/v1/bundles/Master/data/name:excel/derived/1.0.0/TabName/TabName")

 
Posted : 17/02/2021 2:39 pm
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Thank you! 

I will test it - waiting for developer when system will be refreshed. 

Best,
Jacek

 
Posted : 26/02/2021 4:12 am
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Hi, 

i tested and it is not working. 
It is changing whole url to encoding signs and trying to get data from encoded string. 

Where problem is that i have to not send PQ request with %2F. 
IT should send "%2F" as text, not changing anything - problem is that PQ is changing it for "/" before my Server - and this cause error. 

I didnt find any solution on web and i am afraid that this is very bug bug in PQ --> i would like to inform about it to microsoft. Where can i do this?

Best,
Jacek

 
Posted : 27/02/2021 10:21 am
(@catalinb)
Posts: 1937
Member Admin
 

Where is the csv name in your url?
Not seeing it in any of your posted code.

Web.Contents is NOT Folder.Files, in case you want to get multiple csv files from a web folder address, will not just give you a list of csv files.

Try step by step:

Source=Web.Contents("http://localhost:8080/BundleService-1.0.0/v1/bundles/Master/data/name:excel/derived/1.0.0/TabName/TabName"),

then analyze the response, take actions according to what the web page returns.

Web.Contents will return a html structure, you need to navigate to the html container that holds the files...

 
Posted : 27/02/2021 12:51 pm
(@jaryszek)
Posts: 177
Reputable Member
Topic starter
 

Hi Catalin,

i have csv on server provided by java environment. CSV is sitting on server disc with normal folder and subfolders structure.

On server i am getting folder url but within folder i have subfolder which PQ doesnt know how to read. It lost when i want to send request "2%F" because PQ is changing it automatically without any other possibilities (like sending just clean url string without encoding automatically). 

So when i do not have subfolder in folder url is working - i have just slashes, PQ read web contents like CSV and importing. 
But issue is when i want to pass just string 2%F which has to be send to url and server should decode it, not PQ....

I want to write about lacking of this feature to Microsoft.

Best,
Jacek

 
Posted : 28/02/2021 8:22 am
Share: