PowerBI - Glide API Power Query

Has anyone connected to a GlideTable using PowerBI directly via Power Query and the GlideAPI?

I believe you need to write a Power Query and start from a blank query since the Glide API is all POST requests.

I am just struggling with the format as I am new to PowerBI but I figure someone has already done this somewhere.

This is my PowerQuery code, XXX replace my app info:

let
    url = "https://api.glideapp.io/api/function/queryTables",
    header=[#"Content-Type"="application/json", #"Authorization"="Bearer XXX"],
    body = [appID = "XXX", queries = {[tableName =  "native-table-XXX", utc = "true"]}],
    response = Web.Contents(
        url, 
        [
            Headers = header,
            Content = Json.FromValue(body)
        ]
    ),
    jsonResponse = Json.Document(response)
in
    jsonResponse

Has anyone else had any luck with this? I get an Error 400 with this query above.

Well, I was able to figure it out by adjusting the body variable to a more standard JSON format instead of the M language type.

If anyone is interested, below is the Power Query to bring table data directly into PowerBI:

let
    url = "https://api.glideapp.io/api/function/queryTables",
    header=[#"Content-Type"="application/json", #"Authorization"="Bearer XXX"],
    body = "{
    ""appID"": ""XXX"",
    ""queries"": [
        {
            ""tableName"": ""native-table-XXX"", 
            ""utc"": true
        }
    ]
}",
    response = Web.Contents(
        url, 
        [
            Headers= header, 
            Content = Text.ToBinary(body)
        ]
    ),
    jsonResponse = Json.Document(response)
in
    jsonResponse
1 Like

Hi @ScottLLC,

I am trying this but get the following error:


Do you have any suggestions?

Hard to tell without seeing your code fully.

Did you paste the full text of my code into the editor? Did you replace the XXX with your app and table IDs as needed?

Hi @ScottLLC,
Thanks for posting this code. I am now able to connect directly from PowerBI to Glide in PowerBI desktop. However once I publish my file to PowerBI I can’t refresh the semantic model from the cloud interface. When I try I get an error msg…

  • Data source errorScheduled refresh is disabled because at least one data source is missing credentials. To start the refresh again, go to this dataset’s settings page and enter credentials for all data sources. Then reactivate scheduled refresh.

The credentials are embedded in the code you posted above so not sure why i can’t refresh from the cloud when it works fine from the desktop.

If I try to edit the credentials in the settings for the semantic model I can’t get it to authenticate.

Have you run into this?
Thanks!