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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
JoseCVM
Employee
Employee

Custom Connector and Navigation Tables

Hello,

 

I'm new to powerquery and dataconnectors, and I'm having trouble implementing the user flow I designed. Basically, it should go like this:

 

Authentication: KEY

TableName: FOO

 

It hits back to the database, and checks if tableFOO exists. If it does, it returns the data as normal. If it doesnt, it should direct the user to a navigation table of all available tables. This is where I'm having trouble. Once at the Navigation Table, things should look like this:

 

KEY

|  TABLE1

|  TABLE2

...

| TABLEN

 

And upon selecting a table, it should show only the table's schema with dummy data (So I dont retrieve all the data for all the tables). The problem is, all I seem to be able to do with the NavTable is load up the raw data. Once I click load, it tries to actually load the selected item. Is it possible to redirect this to another direct query? If so, how do I go about it, and are there any good examples of how this works? I suspect that this example goes in the direction I want, but I'm not sure.

1 ACCEPTED SOLUTION
artemus
Employee
Employee

What you need to do is use Table.View, it is very powerful as it lets you reinterpate any code that transforms or drills into a table. In paticular you want to include a defination for the handler OnSelectRows:

 

View= (state) =>

Table.View(null, 

[

GetType = () => ...,

GetRows = () =>  ...,

OnSelectRows = (selector) =>
let
condition = RowExpression.From(selector),

...,

in

@View(newState)

])

 

The selector will be the abstract syntax tree of the query. If the code returns an error, then the view is handled by default logic and the next higher view in the stack will be tried.

View solution in original post

23 REPLIES 23

It should return a table based on its input.

 

If the user selects the "FooItem", then it will return the table for FooItem, by making the request and downloading that data.

 

The difference between the two is:

The first one is just a facade so that it shows up as a Table in the UI.

The second one actually gets called to get the data.

Is there more in-depth documentation for the Table.View usage (Or for powerquery and connector development in general)? I've read about it, but most of it is very superficial and I'm having trouble understanding what is the state, how do I make my Navigation Table to also be a table view etc.

Also, am I correct in thinking that the OnSelectRows handler will override the behaviour of the "Load" button when I select one of them to load?


@JoseCVM wrote:

Is there more in-depth documentation for the Table.View usage (Or for powerquery and connector development in general)? I've read about it, but most of it is very superficial and I'm having trouble understanding what is the state, how do I make my Navigation Table to also be a table view etc.

Also, am I correct in thinking that the OnSelectRows handler will override the behaviour of the "Load" button when I select one of them to load?


As far as loading goes. It will override that and potentially further operations past the load button. E.g.  you could program it in such that the user loads the table, then filters it, adds a column and does a group by operation to all be folded into a single request to the server, which would ask the server to aggregate the data instead of downloading it all and then aggregating it.

 

I'm not sure where the definative documentation is for all of this logic. I have access to the source code, so I haven't needed to look for the public documentation on this.

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors