<?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 How to get table directly from GitHUB using web connector and outh2? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-get-table-directly-from-GitHUB-using-web-connector-and/m-p/4658373#M60540</link>
    <description>&lt;P&gt;Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I created ustom connector like here:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[DataSource.Kind="GitHub", Publish="GitHub.Publish"]
shared GitHub.Contents = (repositoryName as text, optional folderPath as text) =&amp;gt;
    let
        baseUrl = "https://api.github.com/",
        url = "repos/xxx/" &amp;amp; repositoryName &amp;amp; "/contents/" &amp;amp; folderPath,
        source = Json.Document(Web.Contents(baseUrl, [
            RelativePath = url,
            Headers = [
                #"Authorization" = "Bearer " &amp;amp; Extension.CurrentCredential()[access_token],
                #"User-Agent" = "PowerQuery"
            ]
        ]))
    in
        source;

GitHub = [
    Authentication = [
        OAuth = [
            StartLogin = (resourceUrl, state, display) =&amp;gt;
                let
                    authorizeUrl = "https://github.com/login/oauth/authorize?" &amp;amp;
                        "client_id=" &amp;amp; client_id &amp;amp;
                        "&amp;amp;redirect_uri=https://oauth.powerbi.com/views/oauthredirect.html" &amp;amp;
                        "&amp;amp;scope=repo" &amp;amp;
                        "&amp;amp;state=" &amp;amp; state
                in
                    [
                        LoginUri = authorizeUrl,
                        CallbackUri = "https://oauth.powerbi.com/views/oauthredirect.html",
                        WindowHeight = 720,
                        WindowWidth = 1024,
                        Context = null
                    ],

            FinishLogin = (context, callbackUri, state) =&amp;gt;
                let
                    parts = Uri.Parts(callbackUri)[Query],
                    code = parts[code],
                    access_token_response = Json.Document(Web.Contents("https://github.com/login/oauth/access_token", [
                        Content = Text.ToBinary("client_id=" &amp;amp; client_id &amp;amp; "&amp;amp;client_secret=" &amp;amp; client_secret &amp;amp; "&amp;amp;code=" &amp;amp; code),
                        Headers = [
                            #"Content-Type" = "application/x-www-form-urlencoded",
                            Accept = "application/json"
                        ]
                    ])),
                    access_token = access_token_response[access_token]
                in
                    [
                        access_token = access_token
                    ],

            Refresh = (resourceUrl, refresh_token) =&amp;gt; error "GitHub does not support refresh tokens.",
            TestConnection = (access_token_record) =&amp;gt; {"https://api.github.com/user"},
            AccessToken = (access_token_record) =&amp;gt; "Bearer " &amp;amp; access_token_record[access_token]
        ]
    ]
];

GitHub.Publish = [
    Beta = true,
    Category = "Other",
    ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
    LearnMoreUrl = "https://powerbi.microsoft.com/",
    SourceImage = GitHub.Icons,
    SourceTypeImage = GitHub.Icons
];

GitHub.Icons = [
    Icon16 = { Extension.Contents("GitHub16.png"), Extension.Contents("GitHub20.png"), Extension.Contents("GitHub24.png"), Extension.Contents("GitHub32.png") },
    Icon32 = { Extension.Contents("GitHub32.png"), Extension.Contents("GitHub40.png"), Extension.Contents("GitHub48.png"), Extension.Contents("GitHub64.png") }
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But i want to add function to get also directly table in csv within the github folder.&lt;BR /&gt;I saw that in a Microsoft sample there is code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[DataSource.Kind="GithubSample"]
shared GithubSample.PagedTable = Value.ReplaceType(Github.PagedTable, type function (url as Uri.Type) as nullable table);&lt;/LI-CODE&gt;&lt;P&gt;Source:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-query/samples/github/readme" target="_self"&gt;https://learn.microsoft.com/en-us/power-query/samples/github/readme&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i do not know how to implement it.&lt;BR /&gt;&lt;BR /&gt;Can anybody help?&amp;nbsp;&lt;BR /&gt;Best,&lt;BR /&gt;Jacek&lt;/P&gt;</description>
    <pubDate>Fri, 18 Apr 2025 05:37:46 GMT</pubDate>
    <dc:creator>jaryszek</dc:creator>
    <dc:date>2025-04-18T05:37:46Z</dc:date>
    <item>
      <title>How to get table directly from GitHUB using web connector and outh2?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-get-table-directly-from-GitHUB-using-web-connector-and/m-p/4658373#M60540</link>
      <description>&lt;P&gt;Hi Guys,&lt;BR /&gt;&lt;BR /&gt;I created ustom connector like here:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[DataSource.Kind="GitHub", Publish="GitHub.Publish"]
shared GitHub.Contents = (repositoryName as text, optional folderPath as text) =&amp;gt;
    let
        baseUrl = "https://api.github.com/",
        url = "repos/xxx/" &amp;amp; repositoryName &amp;amp; "/contents/" &amp;amp; folderPath,
        source = Json.Document(Web.Contents(baseUrl, [
            RelativePath = url,
            Headers = [
                #"Authorization" = "Bearer " &amp;amp; Extension.CurrentCredential()[access_token],
                #"User-Agent" = "PowerQuery"
            ]
        ]))
    in
        source;

GitHub = [
    Authentication = [
        OAuth = [
            StartLogin = (resourceUrl, state, display) =&amp;gt;
                let
                    authorizeUrl = "https://github.com/login/oauth/authorize?" &amp;amp;
                        "client_id=" &amp;amp; client_id &amp;amp;
                        "&amp;amp;redirect_uri=https://oauth.powerbi.com/views/oauthredirect.html" &amp;amp;
                        "&amp;amp;scope=repo" &amp;amp;
                        "&amp;amp;state=" &amp;amp; state
                in
                    [
                        LoginUri = authorizeUrl,
                        CallbackUri = "https://oauth.powerbi.com/views/oauthredirect.html",
                        WindowHeight = 720,
                        WindowWidth = 1024,
                        Context = null
                    ],

            FinishLogin = (context, callbackUri, state) =&amp;gt;
                let
                    parts = Uri.Parts(callbackUri)[Query],
                    code = parts[code],
                    access_token_response = Json.Document(Web.Contents("https://github.com/login/oauth/access_token", [
                        Content = Text.ToBinary("client_id=" &amp;amp; client_id &amp;amp; "&amp;amp;client_secret=" &amp;amp; client_secret &amp;amp; "&amp;amp;code=" &amp;amp; code),
                        Headers = [
                            #"Content-Type" = "application/x-www-form-urlencoded",
                            Accept = "application/json"
                        ]
                    ])),
                    access_token = access_token_response[access_token]
                in
                    [
                        access_token = access_token
                    ],

            Refresh = (resourceUrl, refresh_token) =&amp;gt; error "GitHub does not support refresh tokens.",
            TestConnection = (access_token_record) =&amp;gt; {"https://api.github.com/user"},
            AccessToken = (access_token_record) =&amp;gt; "Bearer " &amp;amp; access_token_record[access_token]
        ]
    ]
];

GitHub.Publish = [
    Beta = true,
    Category = "Other",
    ButtonText = { Extension.LoadString("ButtonTitle"), Extension.LoadString("ButtonHelp") },
    LearnMoreUrl = "https://powerbi.microsoft.com/",
    SourceImage = GitHub.Icons,
    SourceTypeImage = GitHub.Icons
];

GitHub.Icons = [
    Icon16 = { Extension.Contents("GitHub16.png"), Extension.Contents("GitHub20.png"), Extension.Contents("GitHub24.png"), Extension.Contents("GitHub32.png") },
    Icon32 = { Extension.Contents("GitHub32.png"), Extension.Contents("GitHub40.png"), Extension.Contents("GitHub48.png"), Extension.Contents("GitHub64.png") }
];&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But i want to add function to get also directly table in csv within the github folder.&lt;BR /&gt;I saw that in a Microsoft sample there is code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[DataSource.Kind="GithubSample"]
shared GithubSample.PagedTable = Value.ReplaceType(Github.PagedTable, type function (url as Uri.Type) as nullable table);&lt;/LI-CODE&gt;&lt;P&gt;Source:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/power-query/samples/github/readme" target="_self"&gt;https://learn.microsoft.com/en-us/power-query/samples/github/readme&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i do not know how to implement it.&lt;BR /&gt;&lt;BR /&gt;Can anybody help?&amp;nbsp;&lt;BR /&gt;Best,&lt;BR /&gt;Jacek&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 05:37:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-get-table-directly-from-GitHUB-using-web-connector-and/m-p/4658373#M60540</guid>
      <dc:creator>jaryszek</dc:creator>
      <dc:date>2025-04-18T05:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get table directly from GitHUB using web connector and outh2?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-get-table-directly-from-GitHUB-using-web-connector-and/m-p/4658904#M60557</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/107617"&gt;@jaryszek&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;You're doing great so far — building your &lt;STRONG data-start="58" data-end="85"&gt;custom GitHub connector&lt;/STRONG&gt; is not easy stuff.&lt;BR data-start="104" data-end="107" /&gt;I'll help you extend it nicely so you can &lt;STRONG data-start="149" data-end="221"&gt;also fetch CSVs directly from a GitHub repo and load them as a table&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H3 class="" data-start="232" data-end="253"&gt;What you want:&lt;/H3&gt;
&lt;P class="" data-start="254" data-end="292"&gt;Add a function to your connector that:&lt;/P&gt;
&lt;UL data-start="293" data-end="370"&gt;
&lt;LI class="" data-start="293" data-end="330"&gt;
&lt;P class="" data-start="295" data-end="330"&gt;Downloads a &lt;CODE data-start="307" data-end="313"&gt;.csv&lt;/CODE&gt; file from GitHub&lt;/P&gt;
&lt;/LI&gt;
&lt;LI class="" data-start="331" data-end="370"&gt;
&lt;P class="" data-start="333" data-end="370"&gt;Reads it into a &lt;STRONG data-start="349" data-end="370"&gt;Power Query table&lt;/STRONG&gt;&lt;/P&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="" data-start="372" data-end="436"&gt;Exactly like &lt;CODE data-start="385" data-end="410"&gt;GithubSample.PagedTable&lt;/CODE&gt; in the Microsoft example.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;H3 class="" data-start="443" data-end="490"&gt;Here's how you can extend your connector:&lt;/H3&gt;
&lt;P class="" data-start="492" data-end="529"&gt;You &lt;STRONG data-start="496" data-end="518"&gt;add a new function&lt;/STRONG&gt; like this:&lt;BR /&gt;&lt;BR /&gt;[DataSource.Kind="GitHub", Publish="GitHub.Publish"]&lt;BR /&gt;shared GitHub.LoadCsvTable = (repositoryName as text, filePath as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;baseUrl = "&lt;A href="https://raw.githubusercontent.com/xxx/" target="_blank"&gt;https://raw.githubusercontent.com/xxx/&lt;/A&gt;" &amp;amp; repositoryName &amp;amp; "/main/" &amp;amp; filePath,&lt;BR /&gt;csvContent = Web.Contents(baseUrl, [&lt;BR /&gt;Headers = [&lt;BR /&gt;#"Authorization" = "Bearer " &amp;amp; Extension.CurrentCredential()[access_token],&lt;BR /&gt;#"User-Agent" = "PowerQuery"&lt;BR /&gt;]&lt;BR /&gt;]),&lt;BR /&gt;csvTable = Csv.Document(csvContent, [&lt;BR /&gt;Delimiter = ",",&lt;BR /&gt;Columns = 10, // You can change based on your file&lt;BR /&gt;Encoding = 65001, // UTF-8&lt;BR /&gt;QuoteStyle = QuoteStyle.Csv&lt;BR /&gt;])&lt;BR /&gt;in&lt;BR /&gt;csvTable;&lt;BR /&gt;shared GitHub.LoadCsvTable = (repositoryName as text, filePath as text) =&amp;gt;&lt;BR /&gt;let&lt;BR /&gt;baseUrl = "&lt;A href="https://raw.githubusercontent.com/xxx/" target="_blank"&gt;https://raw.githubusercontent.com/xxx/&lt;/A&gt;" &amp;amp; repositoryName &amp;amp; "/main/" &amp;amp; filePath,&lt;BR /&gt;csvContent = Web.Contents(baseUrl, [&lt;BR /&gt;Headers = [&lt;BR /&gt;#"Authorization" = "Bearer " &amp;amp; Extension.CurrentCredential()[access_token],&lt;BR /&gt;#"User-Agent" = "PowerQuery"&lt;BR /&gt;]&lt;BR /&gt;]),&lt;BR /&gt;csvTable = Csv.Document(csvContent, [&lt;BR /&gt;Delimiter = ",",&lt;BR /&gt;Encoding = 65001,&lt;BR /&gt;QuoteStyle = QuoteStyle.Csv&lt;BR /&gt;]),&lt;BR /&gt;output = Table.PromoteHeaders(csvTable)&lt;BR /&gt;in&lt;BR /&gt;output;&lt;/P&gt;
&lt;H3 class="" data-start="2442" data-end="2488"&gt;Then inside Power BI or Power Query UI:&lt;/H3&gt;
&lt;P class="" data-start="2489" data-end="2502"&gt;You can call:&lt;BR /&gt;GitHub.LoadCsvTable("your-repo-name", "folder/subfolder/yourfile.csv")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT color="#800000"&gt;Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P class="" data-start="2489" data-end="2502"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P class="" data-start="492" data-end="529"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 13:57:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-get-table-directly-from-GitHUB-using-web-connector-and/m-p/4658904#M60557</guid>
      <dc:creator>johnbasha33</dc:creator>
      <dc:date>2025-04-18T13:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get table directly from GitHUB using web connector and outh2?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-get-table-directly-from-GitHUB-using-web-connector-and/m-p/4658926#M60558</link>
      <description>&lt;P&gt;thank you!!!&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 14:17:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-get-table-directly-from-GitHUB-using-web-connector-and/m-p/4658926#M60558</guid>
      <dc:creator>jaryszek</dc:creator>
      <dc:date>2025-04-18T14:17:21Z</dc:date>
    </item>
  </channel>
</rss>

