Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello all!
I am having trouble trying to configure the scheduled refresh in Power BI because my data source is dynamic.
My query fetches ticket data from the Movidesk API. The API is paginated, and I use the List.Generate() to paginate through the $top and $skip functions from the API. I believe this is what makes the API url dynamic.
Can anyone help me on how to fix it so that I can use the scheduled refresh?
Thanks
let
// Base URL for the API call
BaseUrl = "https://api.movidesk.com",
// Function to fetch data using Web.Contents
FetchData = (baseUrl as text, skip as number) as nullable list =>
let
// Construct the relative path and query string
RelativePath = "/public/v1/tickets/past",
QueryString = [
token="secret-token",
#"$select"="id,isDeleted,createdDate,type,category,urgency,status,baseStatus,origin,owner,ownerteam,createdBy,tags,resolvedIn,reopenedIn,closedIn,lifetimeWorkingTime,stoppedTimeWorkingTime,lastUpdate,serviceFull,serviceFirstLevel,serviceSecondLevel,serviceThirdLevel,protocol,slaAgreement,slaAgreementRule,slaSolutionTime,slaResponseTime,slaSolutionChangedByUser,slaSolutionChangedBy,slaSolutionDate,slaSolutionDateIsPaused,slaResponseDate,slaRealResponseDate,type,originEmailAccount,createdBy,contactForm,actionCount,resolvedInFirstCall",
#"$orderby"="createdDate asc",
#"$expand"="owner,clients($select=id,businessName,email,personType,profileType),childrenTickets($select=id,isDeleted),parentTickets($select=id,isDeleted),assets($select=name,label,categoryFull,categoryFirstLevel,categorySecondLevel,categoryThirdLevel)",
#"$filter"="createdDate gt 2016-10-01",
#"$top"="100",
#"$skip"=Number.ToText(skip)
],
Source = Web.Contents(baseUrl, [RelativePath=RelativePath, Query=QueryString]),
Data = try Json.Document(Source) otherwise null
in
Data,
// Generate a list of data using List.Generate
Consulta2 = List.Generate(
() => [result= FetchData(BaseUrl, 0), skip = 0],
each [result] <> null and List.Count([result]) > 0,
each [result= FetchData(BaseUrl, [skip] + 100), skip =[skip] + 100],
each [result]
),
// rest of the data modelling
That's an ODATA endpoint. Use the ODATA connector.
Their documentation states that their API has some ODATA features implemented, but it is not an ODATA endpoint. So the ODATA connector does not work.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |