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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
amitbanwar
New Member

Navigation Table to display multiple sheets for data fetched over API

Dear Users,

 

I am facing an issue in converting the data into correct format to display as sheets in navigation table.

 

In below code, I have defined two functions:

Function 1 - FetchQueueInfo - This fetches the list of queue ids

Function 2 - FetchQueueDetail - This fetches the details for an individual queue

 

Now, in order to display each 'queue id' details as a separate table, I am required to iterate over the table and fetch the necessary details and convert it into list in {"name", "data"} format. However, when I am calling below function, I am getting an error - "We cannot convert a value of type Function to type List".

 

// This file contains your Data Connector logic
section AA;

[DataSource.Kind="AA", Publish="AA.Publish"]
shared AA.Contents = () as table =>
let
token = FetchToken(),
queueInfo = FetchQueueInfo(token),
source = #table({"Name", "Data"}, {
each {[queueInfo.description], FetchQueueDetail(token, [queueInfo.id])}
}),
navTable = Table.ToNavigationTable(source, {"Name"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
in
navTable;

 

 

Kindly assist with this query.

2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @amitbanwar ,

 

Did you try to extract the FetchQueueDetail(token, [queueInfo.id]) out as a variable?

 

Best Regards,
Eyelyn Qin

lbendlin
Super User
Super User

Did you forget to specify the return type for FetchQueueDetail()  ?

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors