Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Nikhil_D
Frequent Visitor

Data Source is empty when I use Blank query with API

Hi All,

My API needs to iterate multiple times, so I updated the M code and got the output. However, when I try to refresh the dashboard in Power BI report server, the data source isn't enabled, and when I check the data source settings in Power BI desktop, it's empty. How can I schedule the dashboard?

Below code is used in blank query.

-----------------------------------------------------------------------------------------------------------

let
// Define the function to fetch data from the API
GetData = (url) =>
let
// Make the API request
Source = Json.Document(Web.Contents(url)),
items = Source[items],
hasMore = Source[hasMore],
nextUrl = if hasMore then Source[links]{3}[href] else null,
itemsTable = Table.FromRecords(items)
in
[Items = itemsTable, HasMore = hasMore, NextUrl = nextUrl],

// Define the function to fetch data recursively
FetchDataRecursive = (url, accumulatedData) =>
let
// Fetch the next set of data
nextData = GetData(url),

// Update loop variables
newData = Table.Combine({accumulatedData, nextData[Items]}),
hasNextPage = nextData[HasMore],
nextUrl = nextData[NextUrl]
in
if hasNextPage <> false and nextUrl <> null then
@FetchDataRecursive(nextUrl, newData)
else
newData,

// Initial call to fetch data
apiUrl = "https://au.................................",
initialData = GetData(apiUrl),
finalData = FetchDataRecursive(initialData[NextUrl], initialData[Items])
in
finalData

---------------------------------------------------------------------------------------------------------------------

Datasouce is empty

Nikhil_D_0-1700232336778.png

 



0 REPLIES 0

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.