Forum Discussion

zua's avatar
zua
Frequent Visitor
2 years ago
Solved

Custom Connector: Display icons in navigator

Hello, 

 

I followed the documentation for navigation tables on Handling navigation for Power Query connectors - Power Query | Microsoft Learn

But now I have problems to change the icons in the navigator.

 

I change the values of ItemKind and ItemName to display folder, database and function icons.

I know that the data column has got table values, but this is just for testing purpose.

 

objects = #table(
            {"Name",       "Key",        "Data",                           "ItemKind", "ItemName", "IsLeaf"},{
            {"Item1",      "item1",      #table({"Column1"}, {{"Item1"}}), "Folder",    "Folder",    true},
            {"Item2",      "item2",      #table({"Column1"}, {{"Item2"}}), "Database",    "Database",    true},
            {"Item3",      "item3",      FunctionCallThatReturnsATable(),  "Folder",    "Folder",    true},            
            {"MyFunction", "myfunction", FunctionCallThatReturnsATable(),       "Function", "Function", true}
            }),
        NavTable = Table.ToNavigationTable(objects, {"Key"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
    in
        NavTable;

 

But that does not change the icons displayed in the navigator:.

 

Can the icons of entries of nav table be changed somehow?

And what is the purpose of the ItemKind and ItemName column in a nav table?

 

Thx

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi zua ,

    This is what the ItemKind and ItemName column defines:

    But the exact type of icon that will be displayed depends on what you are returning.
    For example, here you want to define a function, but here you use FunctionCallThatReturnsATable(), which as the name suggests will return a table, so it doesn't define it as a function but as a table:


    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.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi zua ,

    This is what the ItemKind and ItemName column defines:

    But the exact type of icon that will be displayed depends on what you are returning.
    For example, here you want to define a function, but here you use FunctionCallThatReturnsATable(), which as the name suggests will return a table, so it doesn't define it as a function but as a table:


    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.