<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom connector for api with navigation table in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-for-api-with-navigation-table/m-p/3449171#M44692</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to make a connection to api where you select columns which you want to see and it according to that creates api request and generates you a new table with your selected columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do everything on TripPin NavTables example, but I don't understand how to make that so it selects columns to show on the table, and not that every selection shows you just different table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code now is this (which I don't udenrstand why it doesn't work as I want):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;section TripPin;

//
// Definition
//
// Data Source Kind description
TripPin = [
    Authentication = [
        Anonymous = []
    ],
    Label = "FB Navigator"
];

// Data Source UI publishing description
TripPin.Publish = [
    Beta = true,
    Category = "Other",
    ButtonText = {"FB Navigator", "FB Navigator"}
];

//
// Implementation
//
[DataSource.Kind = "TripPin"]
shared TripPin.Feed = Value.ReplaceType(TripPinImpl, TripPinNavType);

[DataSource.Kind = "TripPin", Publish = "TripPin.Publish"]
shared TripPin.Contents = Value.ReplaceType(TripPinNavTable, TripPinNavType);

TripPinNavType = type function ( 
    accID as (
        type text meta [
            Documentation.FieldCaption = "Account ID",
            Documentation.FieldDescription = "įrašykite account id kuris randamas facebook developers puslapyje",
            Documentation.SampleValues = {"1234567890", "0987654321"}
        ]
    ),
    API_key as (
        type text meta [
            Documentation.FieldCaption = "API token",
            Documentation.FieldDescription = "koks yra jūsų sukurtos aplikacijos API raktas",
            Documentation.SampleValues = {"HFHVJ5457JHBJH567HGH", "5637HGFHJJKJKBJ788"}
        ]
    )
) as table meta [
    Documentation.Name = "Facebook API conection",
    Documentation.LongDescription = "Facebook API conection LONG"
];






TripPinImpl = (accID as text, API_key as text) =&amp;gt;
    let
        urll = "http://services.odata.org/v4/TripPinService/Airlines",
        source = Web.Contents(urll), json = Json.Document(source)
    in
        json;

TripPinNavTable = (accID as text, API_key as text) as table =&amp;gt;
    let
        source = #table(
            {"Name", "Data", "ItemKind", "ItemName", "IsLeaf"},
            {
                {"Airlines", GetAirlinesTable(accID, API_key), "Table", "Table", false},
                {"Airports", GetAirportsTable(accID, API_key), "Table", "Table", false}
            }
        ),
        navTable = Table.ToNavigationTable(source, {"Name"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
    in
        navTable;

GetAirlinesTable = (accID as text, API_key as text) as table =&amp;gt;
    let
        source = TripPin.Feed(accID, API_key),
        value = source[value],
        toTable = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        expand = Table.ExpandRecordColumn(toTable, "Column1", {"AirlineCode", "Name"}, {"AirlineCode", "Name"})
    in
        expand;

GetAirportsTable = (accID as text, API_key as text) as table =&amp;gt;
    let
        source = TripPin.Feed(accID, API_key),
        value = source[value],
        toTable = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        expand = Table.ExpandRecordColumn(toTable, "Column1", {"AirlineCode", "Name"}, {"AirlineCode", "Name"})
    in
        expand;

//
// Common functions
//
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 =&amp;gt;
    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;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 Sep 2023 07:37:37 GMT</pubDate>
    <dc:creator>Matas_skYwolf</dc:creator>
    <dc:date>2023-09-27T07:37:37Z</dc:date>
    <item>
      <title>Custom connector for api with navigation table</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-for-api-with-navigation-table/m-p/3449171#M44692</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to make a connection to api where you select columns which you want to see and it according to that creates api request and generates you a new table with your selected columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to do everything on TripPin NavTables example, but I don't understand how to make that so it selects columns to show on the table, and not that every selection shows you just different table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code now is this (which I don't udenrstand why it doesn't work as I want):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;section TripPin;

//
// Definition
//
// Data Source Kind description
TripPin = [
    Authentication = [
        Anonymous = []
    ],
    Label = "FB Navigator"
];

// Data Source UI publishing description
TripPin.Publish = [
    Beta = true,
    Category = "Other",
    ButtonText = {"FB Navigator", "FB Navigator"}
];

//
// Implementation
//
[DataSource.Kind = "TripPin"]
shared TripPin.Feed = Value.ReplaceType(TripPinImpl, TripPinNavType);

[DataSource.Kind = "TripPin", Publish = "TripPin.Publish"]
shared TripPin.Contents = Value.ReplaceType(TripPinNavTable, TripPinNavType);

TripPinNavType = type function ( 
    accID as (
        type text meta [
            Documentation.FieldCaption = "Account ID",
            Documentation.FieldDescription = "įrašykite account id kuris randamas facebook developers puslapyje",
            Documentation.SampleValues = {"1234567890", "0987654321"}
        ]
    ),
    API_key as (
        type text meta [
            Documentation.FieldCaption = "API token",
            Documentation.FieldDescription = "koks yra jūsų sukurtos aplikacijos API raktas",
            Documentation.SampleValues = {"HFHVJ5457JHBJH567HGH", "5637HGFHJJKJKBJ788"}
        ]
    )
) as table meta [
    Documentation.Name = "Facebook API conection",
    Documentation.LongDescription = "Facebook API conection LONG"
];






TripPinImpl = (accID as text, API_key as text) =&amp;gt;
    let
        urll = "http://services.odata.org/v4/TripPinService/Airlines",
        source = Web.Contents(urll), json = Json.Document(source)
    in
        json;

TripPinNavTable = (accID as text, API_key as text) as table =&amp;gt;
    let
        source = #table(
            {"Name", "Data", "ItemKind", "ItemName", "IsLeaf"},
            {
                {"Airlines", GetAirlinesTable(accID, API_key), "Table", "Table", false},
                {"Airports", GetAirportsTable(accID, API_key), "Table", "Table", false}
            }
        ),
        navTable = Table.ToNavigationTable(source, {"Name"}, "Name", "Data", "ItemKind", "ItemName", "IsLeaf")
    in
        navTable;

GetAirlinesTable = (accID as text, API_key as text) as table =&amp;gt;
    let
        source = TripPin.Feed(accID, API_key),
        value = source[value],
        toTable = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        expand = Table.ExpandRecordColumn(toTable, "Column1", {"AirlineCode", "Name"}, {"AirlineCode", "Name"})
    in
        expand;

GetAirportsTable = (accID as text, API_key as text) as table =&amp;gt;
    let
        source = TripPin.Feed(accID, API_key),
        value = source[value],
        toTable = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        expand = Table.ExpandRecordColumn(toTable, "Column1", {"AirlineCode", "Name"}, {"AirlineCode", "Name"})
    in
        expand;

//
// Common functions
//
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 =&amp;gt;
    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;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2023 07:37:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-connector-for-api-with-navigation-table/m-p/3449171#M44692</guid>
      <dc:creator>Matas_skYwolf</dc:creator>
      <dc:date>2023-09-27T07:37:37Z</dc:date>
    </item>
  </channel>
</rss>

