<?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 Adding navigation table to show tables - Custom Connector in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Adding-navigation-table-to-show-tables-Custom-Connector/m-p/2520762#M36149</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successfully created a Custom Connector which connects to Xero using OAuth2.&lt;/P&gt;&lt;P&gt;I am able to connect to 1 table (&lt;SPAN&gt;&lt;A href="https://api.xero.com/api.xro/2.0/BankTransactions" target="_blank" rel="noopener"&gt;https://api.xero.com/api.xro/2.0/BankTransactions&lt;/A&gt;&lt;/SPAN&gt;) ie. Endpoint/GET Request.&lt;/P&gt;&lt;P&gt;This is what happens when it connects and authentics - It takes me straight to Power Query with the 1 table only.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBI_Monkey_1-1652795607919.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/716591i9D93C0DB46331DA6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PBI_Monkey_1-1652795607919.png" alt="PBI_Monkey_1-1652795607919.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBI_Monkey_2-1652795676827.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/716592iC6CB6ED531B9658C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PBI_Monkey_2-1652795676827.png" alt="PBI_Monkey_2-1652795676827.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of only being able to see 1 table/Endpoint, I'd like to be able to choose from multiple tables, shown in a Navigation Table eg:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBI_Monkey_0-1652795202341.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/716585iC23AA17715CBA0A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PBI_Monkey_0-1652795202341.png" alt="PBI_Monkey_0-1652795202341.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried a few things in the code, but I have no idea what or where to add the code to show a Navigation Table.&lt;/P&gt;&lt;P&gt;I'm not a developer, so seem to be going around in circles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;This is my working code:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// This file contains your Data Connector logic&lt;BR /&gt;section XeroConnectorTest;&lt;/P&gt;&lt;P&gt;// XeroConnectorTest OAuth2 values&lt;BR /&gt;client_id = Text.FromBinary(Extension.Contents("client_id.txt"));&lt;BR /&gt;client_secret = Text.FromBinary(Extension.Contents("client_secret.txt"));&lt;BR /&gt;redirect_uri = "&lt;A href="https://xero.com/" target="_blank"&gt;https://xero.com/&lt;/A&gt;";&lt;BR /&gt;token_uri = "&lt;A href="https://identity.xero.com/connect/token?=" target="_blank"&gt;https://identity.xero.com/connect/token?=&lt;/A&gt;";&lt;BR /&gt;authorize_uri = "&lt;A href="https://login.xero.com/identity/connect/authorize" target="_blank"&gt;https://login.xero.com/identity/connect/authorize&lt;/A&gt;";&lt;BR /&gt;logout_uri = "&lt;A href="https://login.microsoftonline.com/logout.srf" target="_blank"&gt;https://login.microsoftonline.com/logout.srf&lt;/A&gt;";&lt;BR /&gt;connection_uri = "&lt;A href="https://api.xero.com/connections" target="_blank"&gt;https://api.xero.com/connections&lt;/A&gt;";&lt;BR /&gt;tenantid = Text.From(GetTenantId(connection_uri));&lt;/P&gt;&lt;P&gt;// Login modal window dimensions&lt;BR /&gt;windowWidth = 720;&lt;BR /&gt;windowHeight = 1024;&lt;/P&gt;&lt;P&gt;//OAuth2 Scopes&lt;BR /&gt;scope_prefix = "";&lt;BR /&gt;scopes = {&lt;BR /&gt;"offline_access",&lt;BR /&gt;"openid",&lt;BR /&gt;"profile",&lt;BR /&gt;"email",&lt;BR /&gt;"accounting.transactions.read",&lt;BR /&gt;"accounting.transactions",&lt;BR /&gt;"accounting.reports.read",&lt;BR /&gt;"accounting.journals.read",&lt;BR /&gt;"accounting.contacts.read"&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;GetTenantId = (url as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;Source = Web.Contents(url),&lt;BR /&gt;ImportedJSON = Json.Document(Source,1252),&lt;BR /&gt;ConvertedtoTable = Table.FromList(ImportedJSON, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;ExpandedColumn1 = Table.ExpandRecordColumn(ConvertedtoTable, "Column1", {"id", "authEventId", "tenantId", "tenantType", "tenantName", "createdDateUtc", "updatedDateUtc"}, {"id", "authEventId", "tenantId", "tenantType", "tenantName", "createdDateUtc", "updatedDateUtc"}),&lt;BR /&gt;ChangedType = Table.TransformColumnTypes(ExpandedColumn1,{{"id", type text}, {"authEventId", type text}, {"tenantId", type text}, {"tenantType", type text}, {"tenantName", type text}, {"createdDateUtc", type datetime}, {"updatedDateUtc", type datetime}}),&lt;BR /&gt;tenantId = Text.From(ChangedType{0}[tenantId])&lt;BR /&gt;in&lt;BR /&gt;tenantId;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[DataSource.Kind="XeroConnectorTest", Publish="XeroConnectorTest.Publish"]&lt;BR /&gt;shared XeroConnectorTest.Contents = (url as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;source = Json.Document(Web.Contents(url,[Headers = [#"xero-tenant-id"=tenantid,#"Accept" = "application/json"]]))&lt;BR /&gt;in&lt;BR /&gt;source;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Data Source Kind description&lt;BR /&gt;XeroConnectorTest= [&lt;BR /&gt;TestConnection = (DataSourcePath) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;json = Json.Document(DataSourcePath),&lt;BR /&gt;server = json[server],&lt;BR /&gt;database = json[database]&lt;BR /&gt;in&lt;BR /&gt;try&lt;BR /&gt;{ "XeroConnectorTest.Contents", server, database }&lt;BR /&gt;otherwise&lt;BR /&gt;let&lt;BR /&gt;message = Text.Format("Couldn't find entity.")&lt;BR /&gt;in&lt;BR /&gt;Diagnostics.Trace(TraceLevel.Error, message, () =&amp;gt; error message, true )&lt;BR /&gt;,&lt;/P&gt;&lt;P&gt;Authentication = [&lt;BR /&gt;OAuth = [&lt;BR /&gt;StartLogin=StartLogin,&lt;BR /&gt;FinishLogin=FinishLogin,&lt;BR /&gt;Refresh=Refresh,&lt;BR /&gt;Logout=Logout&lt;BR /&gt;]&lt;BR /&gt;],&lt;BR /&gt;Label = Extension.LoadString("DataSourceLabel")&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Data Source UI publishing description&lt;BR /&gt;XeroConnectorTest.Publish = [&lt;BR /&gt;Beta = true,&lt;BR /&gt;Category = "Other",&lt;BR /&gt;ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },&lt;BR /&gt;LearnMoreUrl = "&lt;A href="https://powerbi.microsoft.com/" target="_blank"&gt;https://powerbi.microsoft.com/&lt;/A&gt;",&lt;BR /&gt;SourceImage = XeroConnectorTest.Icons,&lt;BR /&gt;SourceTypeImage = XeroConnectorTest.Icons&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// Helper functions for OAuth2: StartLogin, FinishLogin, Refresh, Logout&lt;BR /&gt;StartLogin = (resourceUrl, state, display) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;authorizeUrl = authorize_uri &amp;amp; "?" &amp;amp; Uri.BuildQueryString([&lt;BR /&gt;response_type = "code",&lt;BR /&gt;client_id = client_id,&lt;BR /&gt;redirect_uri = redirect_uri,&lt;BR /&gt;state = state,&lt;BR /&gt;scope = GetScopeString(scopes, scope_prefix)&lt;BR /&gt;])&lt;BR /&gt;in&lt;BR /&gt;[&lt;BR /&gt;LoginUri = authorizeUrl,&lt;BR /&gt;CallbackUri = redirect_uri,&lt;BR /&gt;WindowHeight = 720,&lt;BR /&gt;WindowWidth = 1024,&lt;BR /&gt;Context = null&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;FinishLogin = (context, callbackUri, state) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;// parse the full callbackUri, and extract the Query string&lt;BR /&gt;parts = Uri.Parts(callbackUri)[Query],&lt;BR /&gt;// if the query string contains an "error" field, raise an error&lt;BR /&gt;// otherwise call TokenMethod to exchange our code for an access_token&lt;BR /&gt;result = if (Record.HasFields(parts, {"error", "error_description"})) then&lt;BR /&gt;error Error.Record(parts[error], parts[error_description], parts)&lt;BR /&gt;else&lt;BR /&gt;TokenMethod("authorization_code", "code", parts[code])&lt;BR /&gt;in&lt;BR /&gt;result;&lt;/P&gt;&lt;P&gt;Refresh = (resourceUrl, refresh_token) =&amp;gt; TokenMethod("refresh_token", "refresh_token", refresh_token);&lt;/P&gt;&lt;P&gt;Logout = (token) =&amp;gt; logout_uri;&lt;/P&gt;&lt;P&gt;// see "Exchange code for access token: POST /oauth/token" at &lt;A href="https://cloud.ouraring.com/docs/authentication" target="_blank"&gt;https://cloud.ouraring.com/docs/authentication&lt;/A&gt; for details&lt;BR /&gt;TokenMethod = (grantType, tokenField, code) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;query = [&lt;BR /&gt;grant_type = grantType,&lt;BR /&gt;redirect_uri = redirect_uri,&lt;BR /&gt;client_id = client_id,&lt;BR /&gt;client_secret = client_secret&lt;BR /&gt;],&lt;BR /&gt;queryWithCode = if(grantType = "refresh_token") then [refresh_token = code] else [code = code],&lt;/P&gt;&lt;P&gt;tokenResponse = Web.Contents(token_uri, [&lt;BR /&gt;Content = Text.ToBinary(Uri.BuildQueryString(query &amp;amp; queryWithCode)),&lt;/P&gt;&lt;P&gt;Headers= [#"Content-type" = "application/x-www-form-urlencoded",#"Accept" = "application/json"],&lt;BR /&gt;ManualStatusHandling = {400}&lt;BR /&gt;]),&lt;BR /&gt;body = Json.Document(tokenResponse),&lt;BR /&gt;result = if (Record.HasFields(body, {"error", "error_description"})) then&lt;BR /&gt;error Error.Record(body[error], body[error_description], body)&lt;BR /&gt;else&lt;BR /&gt;body&lt;BR /&gt;in&lt;BR /&gt;result;&lt;/P&gt;&lt;P&gt;Value.IfNull = (a, b) =&amp;gt; if a &amp;lt;&amp;gt; null then a else b;&lt;/P&gt;&lt;P&gt;GetScopeString = (scopes as list, optional scopePrefix as text) as text =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;prefix = Value.IfNull(scopePrefix, ""),&lt;BR /&gt;addPrefix = List.Transform(scopes, each prefix &amp;amp; _),&lt;BR /&gt;asText = Text.Combine(addPrefix, " ")&lt;BR /&gt;in&lt;BR /&gt;asText;&lt;/P&gt;&lt;P&gt;XeroConnectorTest.Icons = [&lt;BR /&gt;Icon16 = { Extension.Contents("XeroConnectorTest16.png"), Extension.Contents("XeroConnectorTest20.png"), Extension.Contents("XeroConnectorTest24.png"), Extension.Contents("XeroConnectorTest32.png") },&lt;BR /&gt;Icon32 = { Extension.Contents("XeroConnectorTest32.png"), Extension.Contents("XeroConnectorTest40.png"), Extension.Contents("XeroConnectorTest48.png"), Extension.Contents("XeroConnectorTest64.png") }&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas would be amazing! I believe I'm almost there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 May 2022 14:26:56 GMT</pubDate>
    <dc:creator>PBI_Monkey</dc:creator>
    <dc:date>2022-05-17T14:26:56Z</dc:date>
    <item>
      <title>Adding navigation table to show tables - Custom Connector</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Adding-navigation-table-to-show-tables-Custom-Connector/m-p/2520762#M36149</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successfully created a Custom Connector which connects to Xero using OAuth2.&lt;/P&gt;&lt;P&gt;I am able to connect to 1 table (&lt;SPAN&gt;&lt;A href="https://api.xero.com/api.xro/2.0/BankTransactions" target="_blank" rel="noopener"&gt;https://api.xero.com/api.xro/2.0/BankTransactions&lt;/A&gt;&lt;/SPAN&gt;) ie. Endpoint/GET Request.&lt;/P&gt;&lt;P&gt;This is what happens when it connects and authentics - It takes me straight to Power Query with the 1 table only.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBI_Monkey_1-1652795607919.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/716591i9D93C0DB46331DA6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PBI_Monkey_1-1652795607919.png" alt="PBI_Monkey_1-1652795607919.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBI_Monkey_2-1652795676827.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/716592iC6CB6ED531B9658C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PBI_Monkey_2-1652795676827.png" alt="PBI_Monkey_2-1652795676827.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of only being able to see 1 table/Endpoint, I'd like to be able to choose from multiple tables, shown in a Navigation Table eg:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PBI_Monkey_0-1652795202341.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/716585iC23AA17715CBA0A4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PBI_Monkey_0-1652795202341.png" alt="PBI_Monkey_0-1652795202341.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried a few things in the code, but I have no idea what or where to add the code to show a Navigation Table.&lt;/P&gt;&lt;P&gt;I'm not a developer, so seem to be going around in circles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;This is my working code:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// This file contains your Data Connector logic&lt;BR /&gt;section XeroConnectorTest;&lt;/P&gt;&lt;P&gt;// XeroConnectorTest OAuth2 values&lt;BR /&gt;client_id = Text.FromBinary(Extension.Contents("client_id.txt"));&lt;BR /&gt;client_secret = Text.FromBinary(Extension.Contents("client_secret.txt"));&lt;BR /&gt;redirect_uri = "&lt;A href="https://xero.com/" target="_blank"&gt;https://xero.com/&lt;/A&gt;";&lt;BR /&gt;token_uri = "&lt;A href="https://identity.xero.com/connect/token?=" target="_blank"&gt;https://identity.xero.com/connect/token?=&lt;/A&gt;";&lt;BR /&gt;authorize_uri = "&lt;A href="https://login.xero.com/identity/connect/authorize" target="_blank"&gt;https://login.xero.com/identity/connect/authorize&lt;/A&gt;";&lt;BR /&gt;logout_uri = "&lt;A href="https://login.microsoftonline.com/logout.srf" target="_blank"&gt;https://login.microsoftonline.com/logout.srf&lt;/A&gt;";&lt;BR /&gt;connection_uri = "&lt;A href="https://api.xero.com/connections" target="_blank"&gt;https://api.xero.com/connections&lt;/A&gt;";&lt;BR /&gt;tenantid = Text.From(GetTenantId(connection_uri));&lt;/P&gt;&lt;P&gt;// Login modal window dimensions&lt;BR /&gt;windowWidth = 720;&lt;BR /&gt;windowHeight = 1024;&lt;/P&gt;&lt;P&gt;//OAuth2 Scopes&lt;BR /&gt;scope_prefix = "";&lt;BR /&gt;scopes = {&lt;BR /&gt;"offline_access",&lt;BR /&gt;"openid",&lt;BR /&gt;"profile",&lt;BR /&gt;"email",&lt;BR /&gt;"accounting.transactions.read",&lt;BR /&gt;"accounting.transactions",&lt;BR /&gt;"accounting.reports.read",&lt;BR /&gt;"accounting.journals.read",&lt;BR /&gt;"accounting.contacts.read"&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;GetTenantId = (url as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;Source = Web.Contents(url),&lt;BR /&gt;ImportedJSON = Json.Document(Source,1252),&lt;BR /&gt;ConvertedtoTable = Table.FromList(ImportedJSON, Splitter.SplitByNothing(), null, null, ExtraValues.Error),&lt;BR /&gt;ExpandedColumn1 = Table.ExpandRecordColumn(ConvertedtoTable, "Column1", {"id", "authEventId", "tenantId", "tenantType", "tenantName", "createdDateUtc", "updatedDateUtc"}, {"id", "authEventId", "tenantId", "tenantType", "tenantName", "createdDateUtc", "updatedDateUtc"}),&lt;BR /&gt;ChangedType = Table.TransformColumnTypes(ExpandedColumn1,{{"id", type text}, {"authEventId", type text}, {"tenantId", type text}, {"tenantType", type text}, {"tenantName", type text}, {"createdDateUtc", type datetime}, {"updatedDateUtc", type datetime}}),&lt;BR /&gt;tenantId = Text.From(ChangedType{0}[tenantId])&lt;BR /&gt;in&lt;BR /&gt;tenantId;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;[DataSource.Kind="XeroConnectorTest", Publish="XeroConnectorTest.Publish"]&lt;BR /&gt;shared XeroConnectorTest.Contents = (url as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;source = Json.Document(Web.Contents(url,[Headers = [#"xero-tenant-id"=tenantid,#"Accept" = "application/json"]]))&lt;BR /&gt;in&lt;BR /&gt;source;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Data Source Kind description&lt;BR /&gt;XeroConnectorTest= [&lt;BR /&gt;TestConnection = (DataSourcePath) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;json = Json.Document(DataSourcePath),&lt;BR /&gt;server = json[server],&lt;BR /&gt;database = json[database]&lt;BR /&gt;in&lt;BR /&gt;try&lt;BR /&gt;{ "XeroConnectorTest.Contents", server, database }&lt;BR /&gt;otherwise&lt;BR /&gt;let&lt;BR /&gt;message = Text.Format("Couldn't find entity.")&lt;BR /&gt;in&lt;BR /&gt;Diagnostics.Trace(TraceLevel.Error, message, () =&amp;gt; error message, true )&lt;BR /&gt;,&lt;/P&gt;&lt;P&gt;Authentication = [&lt;BR /&gt;OAuth = [&lt;BR /&gt;StartLogin=StartLogin,&lt;BR /&gt;FinishLogin=FinishLogin,&lt;BR /&gt;Refresh=Refresh,&lt;BR /&gt;Logout=Logout&lt;BR /&gt;]&lt;BR /&gt;],&lt;BR /&gt;Label = Extension.LoadString("DataSourceLabel")&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;// Data Source UI publishing description&lt;BR /&gt;XeroConnectorTest.Publish = [&lt;BR /&gt;Beta = true,&lt;BR /&gt;Category = "Other",&lt;BR /&gt;ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },&lt;BR /&gt;LearnMoreUrl = "&lt;A href="https://powerbi.microsoft.com/" target="_blank"&gt;https://powerbi.microsoft.com/&lt;/A&gt;",&lt;BR /&gt;SourceImage = XeroConnectorTest.Icons,&lt;BR /&gt;SourceTypeImage = XeroConnectorTest.Icons&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;// Helper functions for OAuth2: StartLogin, FinishLogin, Refresh, Logout&lt;BR /&gt;StartLogin = (resourceUrl, state, display) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;authorizeUrl = authorize_uri &amp;amp; "?" &amp;amp; Uri.BuildQueryString([&lt;BR /&gt;response_type = "code",&lt;BR /&gt;client_id = client_id,&lt;BR /&gt;redirect_uri = redirect_uri,&lt;BR /&gt;state = state,&lt;BR /&gt;scope = GetScopeString(scopes, scope_prefix)&lt;BR /&gt;])&lt;BR /&gt;in&lt;BR /&gt;[&lt;BR /&gt;LoginUri = authorizeUrl,&lt;BR /&gt;CallbackUri = redirect_uri,&lt;BR /&gt;WindowHeight = 720,&lt;BR /&gt;WindowWidth = 1024,&lt;BR /&gt;Context = null&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;FinishLogin = (context, callbackUri, state) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;// parse the full callbackUri, and extract the Query string&lt;BR /&gt;parts = Uri.Parts(callbackUri)[Query],&lt;BR /&gt;// if the query string contains an "error" field, raise an error&lt;BR /&gt;// otherwise call TokenMethod to exchange our code for an access_token&lt;BR /&gt;result = if (Record.HasFields(parts, {"error", "error_description"})) then&lt;BR /&gt;error Error.Record(parts[error], parts[error_description], parts)&lt;BR /&gt;else&lt;BR /&gt;TokenMethod("authorization_code", "code", parts[code])&lt;BR /&gt;in&lt;BR /&gt;result;&lt;/P&gt;&lt;P&gt;Refresh = (resourceUrl, refresh_token) =&amp;gt; TokenMethod("refresh_token", "refresh_token", refresh_token);&lt;/P&gt;&lt;P&gt;Logout = (token) =&amp;gt; logout_uri;&lt;/P&gt;&lt;P&gt;// see "Exchange code for access token: POST /oauth/token" at &lt;A href="https://cloud.ouraring.com/docs/authentication" target="_blank"&gt;https://cloud.ouraring.com/docs/authentication&lt;/A&gt; for details&lt;BR /&gt;TokenMethod = (grantType, tokenField, code) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;query = [&lt;BR /&gt;grant_type = grantType,&lt;BR /&gt;redirect_uri = redirect_uri,&lt;BR /&gt;client_id = client_id,&lt;BR /&gt;client_secret = client_secret&lt;BR /&gt;],&lt;BR /&gt;queryWithCode = if(grantType = "refresh_token") then [refresh_token = code] else [code = code],&lt;/P&gt;&lt;P&gt;tokenResponse = Web.Contents(token_uri, [&lt;BR /&gt;Content = Text.ToBinary(Uri.BuildQueryString(query &amp;amp; queryWithCode)),&lt;/P&gt;&lt;P&gt;Headers= [#"Content-type" = "application/x-www-form-urlencoded",#"Accept" = "application/json"],&lt;BR /&gt;ManualStatusHandling = {400}&lt;BR /&gt;]),&lt;BR /&gt;body = Json.Document(tokenResponse),&lt;BR /&gt;result = if (Record.HasFields(body, {"error", "error_description"})) then&lt;BR /&gt;error Error.Record(body[error], body[error_description], body)&lt;BR /&gt;else&lt;BR /&gt;body&lt;BR /&gt;in&lt;BR /&gt;result;&lt;/P&gt;&lt;P&gt;Value.IfNull = (a, b) =&amp;gt; if a &amp;lt;&amp;gt; null then a else b;&lt;/P&gt;&lt;P&gt;GetScopeString = (scopes as list, optional scopePrefix as text) as text =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;prefix = Value.IfNull(scopePrefix, ""),&lt;BR /&gt;addPrefix = List.Transform(scopes, each prefix &amp;amp; _),&lt;BR /&gt;asText = Text.Combine(addPrefix, " ")&lt;BR /&gt;in&lt;BR /&gt;asText;&lt;/P&gt;&lt;P&gt;XeroConnectorTest.Icons = [&lt;BR /&gt;Icon16 = { Extension.Contents("XeroConnectorTest16.png"), Extension.Contents("XeroConnectorTest20.png"), Extension.Contents("XeroConnectorTest24.png"), Extension.Contents("XeroConnectorTest32.png") },&lt;BR /&gt;Icon32 = { Extension.Contents("XeroConnectorTest32.png"), Extension.Contents("XeroConnectorTest40.png"), Extension.Contents("XeroConnectorTest48.png"), Extension.Contents("XeroConnectorTest64.png") }&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas would be amazing! I believe I'm almost there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 14:26:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Adding-navigation-table-to-show-tables-Custom-Connector/m-p/2520762#M36149</guid>
      <dc:creator>PBI_Monkey</dc:creator>
      <dc:date>2022-05-17T14:26:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adding navigation table to show tables - Custom Connector</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Adding-navigation-table-to-show-tables-Custom-Connector/m-p/2528753#M36221</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/376289"&gt;@PBI_Monkey&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your statement, I think you want to use Navigation tables in your custom connector.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can use the&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;Table.ToNavigationTable&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;function to add the table type metadata needed to create a nav table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class=""&gt;
&lt;PRE class=""&gt;&lt;CODE&gt;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;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You may refer to this blog to learn more details about how to&amp;nbsp;&lt;A href="https://github.com/Microsoft/DataConnectors/blob/f90b34a62d17f65b49129066970ce3b82d678374/docs/nav-tables.md#using-navigation-tables" target="_self"&gt;use Navigation Tables.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here is the &lt;A href="https://docs.microsoft.com/en-us/power-query/samples/trippin/3-navtables/readme" target="_self"&gt;offical blog&lt;/A&gt;, I hope it could help you solve your problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 08:50:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Adding-navigation-table-to-show-tables-Custom-Connector/m-p/2528753#M36221</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-20T08:50:09Z</dc:date>
    </item>
  </channel>
</rss>

