Forum Discussion
Scheduled Refresh Custom Function
- 8 years ago
It looks like you may be running into the issue I describe here:
Can you try rewriting so that Web.Contents uses the Query option for your parameters?
Chris
- 8 years ago
Ah, I didn't see that you are doing authentication using a header - no, I don't think it will work (see the comment by danzrust on the blog post). Sorry!
Chris
It looks like you may be running into the issue I describe here:
Can you try rewriting so that Web.Contents uses the Query option for your parameters?
Chris
Hi, cwebb great post, still I have a small issue, my code has two parameters, one part of the URL, the other is a query, thanks to your post I solved the second, still can“t find the right code for the first one.
Parameters are player and season.
Original code:
(Season,Player)=>
let
Source = Web.Page(Web.Contents("http://www.espnfc.com/player/" & Player & "?season="&Season)),
Data3 = Source{3}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data3,{{"Team", type text}, {"Oppo", type text}, {"Date", type date}, {"Comp", type text}, {"Res", type text}, {"Appear", type text}, {"g", Int64.Type}, {"a", Int64.Type}, {"sh", Int64.Type}, {"sg", Int64.Type}, {"fc", Int64.Type}, {"fs", Int64.Type}, {"yc", Int64.Type}, {"rc", Int64.Type}})
in
#"Changed Type"
New code:
"Season" parameter is working, "Player" is the one I'm having the problem with, can't find the right code.
(Season,Player)=>
let
Source = Web.Page(Web.Contents("http://www.espnfc.com/player/" & Player,
[Query=[season=Season]]
)),
Data3 = Source{3}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data3,{{"Team", type text}, {"Oppo", type text}, {"Date", type date}, {"Comp", type text}, {"Res", type text}, {"Appear", type text}, {"g", Int64.Type}, {"a", Int64.Type}, {"sh", Int64.Type}, {"sg", Int64.Type}, {"fc", Int64.Type}, {"fs", Int64.Type}, {"yc", Int64.Type}, {"rc", Int64.Type}})
in
#"Changed Type"
Your support is appreciated.
Regards,
Oscar