Forum Discussion
JustSomeGuy
1 year agoNew 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 se...
ZhangKun
1 year agoSuper User
the query must from Navigation Table, you can see this link: NavigationTable.pq
JustSomeGuy
1 year agoNew Member
Thank you for the suggestion, but I tried the code in the link and the outcome still says "Query1".
- ZhangKun1 year agoSuper User
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 descriptionAfter generating the extension and loading it into Power BI and clicking on it in the connector list:
After clicking the OK button: