Query Based Dropdown List can't convey the array result to my Query?

Issue Summary

My first Query return values in two fields, one is tag (a single text), the other is contracts (a texts array). I prepare to use the contracts in my second Query through Query Based Dropdown List, but it seems the Parameter don’t work like a array and the result is always " Error running query: Invalid query format. The query is not a valid JSON. "

Technical details:

  • Redash Version: Lastest
  • How did you install Redash: Docker-compose
  • Database: MongoDB

The first query result is like:
QQ图片20220530215007

The second query result is like:

I’ll really appriciate it if you can help me !!!

I think the issue here is you need to put square brackets around your tags parameter: [{{ tags }}].

Otherwise, when the parameter is rendered into the document it won’t be valid JSON, which is the error you see.

Thanks! But I’ve had a try, the result was the same :slightly_frowning_face: , like this
QQ截图20220602202835

Did you specify that the values should be wrapped in double quotes?

Yes, I’ve tried everything in setting but it just doesn’t work

Can you share a sample of what the array values look like?


Just like this, an arrary of strings

Does this query work if you manually write in a few of the values from your array? That is, if you remove the parameter and just hard-code them?

[edit] I also notice that your time parameter is automatically appended with 00:00 but already includes a timestamp. Is that intended?

[edit2] Here’s an example of the query with the values hard-coded:

{
  "collection": "Transfer",
  "query": {
    "bc": "ETH",
    "addr": {"$in": ["0xbcd4f1ecff4318e7a0c791c7728f3830db506c71"]},
    "t": {
      "$gt": {
        "$humanTime": "2021-05-01 21:17"
      }
    }
  }
}

The answer of the first question is: yes, when I use hard-code, the query works well, like this


As for timestamp, emmmm, I follow the guidance of the mannul, it says "When using a Date (or Date Range) parameter, wrap it with a $humanTime object: {{param}} becomes {"$humanTime": "{{param}} 00:00"}"

The document you cited is correct. But notice it says you only need to append 00:00 for Date or Date Range types. Not for DateTime types. As you do it today, the value will be invalid: 2021-05-01 21:17 00:00

Have you configured the parameter like this?

Yes, in fact I’ve tried almost all kinds of setting config, but none of them can work :smiling_face_with_tear:

OK, I see, Thanks!
But the problem still can’t be solved, unless I use hard-code :pensive:

I still think this will work.

In the latest screenshot you haven’t wrapped your tags parameter in square brackets so it’s obviously going to be invalid JSON.


No, I’ve tried every possible way… :smiling_face_with_tear:
Maybe it’s the bug of certain version? I’m using the redash image of 8.0.0.b32245, it seems a bit of out of date. But I can’t find the manual for the latest version…