Metabase Module - Execute a Query

Hello

I’m using the Metabase module “Execute a Query”, I have connected my Metabase account and selected my GCP production database, but it asks for the query in JSON format rather than SQL. I’m using the following format for my query and still getting errors (even though I know the result exists). Has anyone successfully executed a query using this module and can help?

I’ve also tried running this WITHOUT the WHERE clause and still getting a 202 no matching clause error

Successful SQL in Metabase

select "mydatabase.organisations.id"
from "mydatabase.organisations"
where "mydatabase.organisations.name" = "ExampleName"

JSON in Make Module - unsuccessful

{
  "query": "SELECT",
  "fields": [
    "mydatabase.organisations.id"
  ],
  "from": "mydatabase.organisations",
  "where": {
    "column": "mydatabase.organisations.name",
    "operator": "=",
    "value": "ExampleName"
  }
}

Has anyone used this module that can help?

Hi @Michaela & @Sam_Heard,

I really would like to help Sam, but when I see that:


An example would not harm the correct use of the module…

BR,

PBI

Found this page too, it really would be nice if they gave a successful example! Found a few others that give the same sort of thing

Thanks anyway

@Philippe_Billet thanks a lot for flagging this :pray:

@Sam_Heard hello and welcome to the community :wave:

I’m really sorry to hear that the Metabase article in our Help Center did not manage to guide you in the right direction. I have passed the feedback on to our tech writing team and will keep you posted on the progress of the improvements.

Thanks to both of you for your feedback :pray:

1 Like

Hello after a while @Sam_Heard :wave:

I noticed that you’ve opened a ticket with us, and our support team has investigated the matter and provided you with the following advice :arrow_down:


Make Support response:

We did some research and, unfortunately, it seems the “query” is not well defined by Metabase itself. They do not provide any example of a successful JSON query or any schema/structure their users could follow.

The best info we could find in their resources is this community topic discussing the same issue you have.

Even though the Make dev team created the Metabase module, it only follows this Metabase API doc where “query” is defined as a standard JSON object without any further details on the proper structure.

We would then recommend checking the query JSON structure with the Metabase support as they should give you the best answer on their API docs.

1 Like