Forum Discussion

PBI_Monkey's avatar
PBI_Monkey
Helper I
4 years ago
Solved

Adding navigation table to show tables - Custom Connector

Hi All,   I have successfully created a Custom Connector which connects to Xero using OAuth2. I am able to connect to 1 table (https://api.xero.com/api.xro/2.0/BankTransactions) ie. Endpoint/GET R...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi  PBI_Monkey ,

     

    According to your statement, I think you want to use Navigation tables in your custom connector.

    You can use the Table.ToNavigationTable function to add the table type metadata needed to create a nav table.

    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;

    You may refer to this blog to learn more details about how to use Navigation Tables.

    Here is the offical blog, I hope it could help you solve your problem.

     

    Best Regards,
    Rico Zhou

     

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