Forum Discussion
Something went wrong, Dataflow publish failed
- 2 years ago
I managed to solve this, I was changing the base URL of the Web.Contents which meant the flow didn't know what connector to use everytime it changed.
Fixed by using one Base URL and then using RelativePath and Query properly.
So I changed this
let FetchPage = (url) => let Source = Json.Document(Web.Contents(url)), Data = Source[data], NextPage = Source[meta][pagination][next], More = Source[meta][pagination][more], Result = if More then Data & @FetchPage(NextPage) else Data in Result, StartURL = "https://api.wonde.com/v1.0/schools?page=1", AllData = FetchPage(StartURL), ...and so on with some more data changesinto this:
FetchPage = (url) => let baseURL = "https://api.wonde.com/v1.0/", relativePath = "schools", queryList = Uri.Parts(url)[Query], response = Web.Contents(baseURL, [ RelativePath = relativePath, Query = queryList ]), Source = Json.Document(response), Data = Source[data], NextPage = Source[meta][pagination][next], More = Source[meta][pagination][more], Result = if More then Data & @FetchPage(NextPage) else Data in Result, StartURL = "https://api.wonde.com/v1.0/schools?page=1", AllData = FetchPage(StartURL),which means it always uses the same connector and is using the relative path correctly.
I managed to solve this, I was changing the base URL of the Web.Contents which meant the flow didn't know what connector to use everytime it changed.
Fixed by using one Base URL and then using RelativePath and Query properly.
So I changed this
let
FetchPage = (url) =>
let
Source = Json.Document(Web.Contents(url)),
Data = Source[data],
NextPage = Source[meta][pagination][next],
More = Source[meta][pagination][more],
Result = if More then Data & @FetchPage(NextPage) else Data
in
Result,
StartURL = "https://api.wonde.com/v1.0/schools?page=1",
AllData = FetchPage(StartURL),
...and so on with some more data changes
into this:
FetchPage = (url) =>
let
baseURL = "https://api.wonde.com/v1.0/",
relativePath = "schools",
queryList = Uri.Parts(url)[Query],
response = Web.Contents(baseURL,
[
RelativePath = relativePath,
Query = queryList
]),
Source = Json.Document(response),
Data = Source[data],
NextPage = Source[meta][pagination][next],
More = Source[meta][pagination][more],
Result = if More then Data & @FetchPage(NextPage) else Data
in
Result,
StartURL = "https://api.wonde.com/v1.0/schools?page=1",
AllData = FetchPage(StartURL),which means it always uses the same connector and is using the relative path correctly.
Hi danielmccluskey ,
Glad that your issue got resolved. Please continue using Fabric Community for help regarding your queries.