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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
JustSomeGuy
New Member

Power Query SDK - Naming the Output Query

I created a custom connector for PowerBI using the Power Query SDK. When I run it in PowerBI the result is always "Query1" (for the frist one, Query2 for the second, etc.).

Is there any way I can set the naming schema of the query using the SDK?

6 REPLIES 6
sangameshks
Helper I
Helper I

@JustSomeGuy I told you  about the default query names. We can request Microsoft for this feature. isnt it?

sangameshks
Helper I
Helper I

In Power Query SDK, the default query names like "Query1" and so on. it doesn't provide a direct method to set a custom naming schema for these queries programmatically. You can choose Power BI Desktop. 

 

I am sharing you 2 document likes so that it can assit you further

 

SDK Dcumentation : https://learn.microsoft.com/en-us/power-query/install-sdk

SDK in Vs Code: https://learn.microsoft.com/en-us/power-query/power-query-sdk-vs-code

ZhangKun
Super User
Super User

the query must from Navigation Table, you can see this link: NavigationTable.pq 

Thank you for the suggestion, but I tried the code in the link and the outcome still says "Query1".

Maybe your code is wrong, or I misunderstood your problem. Here are the code and screenshots.

 

shared TestRename.Contents = (optional message as text) =>
// START!!!!


    SampleTable();

SampleTable = () => 
    let
        objects = #table(
            {"Name", "Key", "Data", "ItemKind", "ItemName", "IsLeaf"},
            {
                {"JustSomeGuy", "item1", #table({"Column1"}, {{1}}), "Table", "Table", true},
                {"Item2", "item2", #table({"Column1"}, {{2}}), "Table", "Table", true}
            }
        ),
        NavTable = Table.ToNavigationTable(objects, {"Key"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
    in
        NavTable;
Table.ToNavigationTable = (
    table as table,
    keyColumns as list,
    nameColumn as text,
    dataColumn as text,
    itemKindColumn as text,
    itemNameColumn as text,
    isLeafColumn as text
) as table =>
    let
        tableType = Value.Type(table),
        newTableType = Type.AddTableKey(tableType, keyColumns, true) meta [
            NavigationTable.NameColumn = nameColumn,
            NavigationTable.DataColumn = dataColumn,
            NavigationTable.ItemKindColumn = itemKindColumn,
            Preview.DelayColumn = itemNameColumn,
            NavigationTable.IsLeafColumn = isLeafColumn
        ],
        navigationTable = Value.ReplaceType(table, newTableType)
    in
        navigationTable;


// END!!!!!
// Data Source Kind description

 

After generating the extension and loading it into Power BI and clicking on it in the connector list:

ZhangKun_1-1734011792334.png

After clicking the OK button:

ZhangKun_2-1734011849667.png

 

Anonymous
Not applicable

Hi @JustSomeGuy ,

I checked the official documentation, but it seems that there is no way to set it. You might try to define the name yourself:

let
    Query1 = YourQueryFunction1(),
    Query2 = YourQueryFunction2()
in
    Record.FromList({Query1, Query2}, {"Query1", "Query2"})


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors