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?