Question widgets disappear when added to dashboard

Ok, so I’ve waded through the gotchas, and have a question with user data entry widgets that are mostly useable. Now I need to use the features that, based on scouring the discussion board, are only available in a dashboard, such as multi-select, search box, etc. However, now that the question is in the dashboard, none of the data entry GUI bits are visible. How can a user possibly enter parameters, without the controls? What could possibly be the point of dsplaying a canned RESULT to a dashboard? What we need to see is the painstakingly constructed “Question” itself, complete with GUI widgets, but hiding the SQL query!? HELP!

Replying to myself. Trying a different approach, starting with an empty dashboard. It suggests “Add a question”. Is that the same as “Ask a question” ? In other words, if I am on a blank dashboard page, and select “Ask A Question”, does that question become part of the dashboard? If not, I see no way to apply a dashboard filter to a question that already has a field filter, since the only data entry I’m allowed in the “question” is default data, not dynamic, user selected filter parameters from a “dashboard filter”. The reason I’m asking here, is because I can’t find any of these answers in the documentation.

Also, the dashboard date range filter offers no way to associate it with a date field in a table, unlike the question field filter.

Still the only one home, it seems. So I tried adding a date range filter to the dashboard. It suggests “Select the field that should be filtered for each card”, right above the “Done” button. It offers no way to do that, but it does let you click the "Done " button. So, what does that do / mean / indicate? No idea what happened, if anything, just “Done” …

This is interesting:

“Setting a variable to the “Field Filter” type allows you to map it to a field in any table in the current database, and lets you display a dropdown filter widget filled with the values of the field you connected it to.”

Sounds cool, except it doesn’t happen:

“There aren’t any filter widgets for this type of field yet”.

So …

OK, by trial and error, I have verified that there is no point trying to add a dashboard date filter until you have added a “question” to that dashboard which has a reference to a date field. It would be nice if that were mentioned in the docs. So, when the suggestion to “Select the field that should be filtered for each card”, what it really means is “question”. I didn’t add a “card”, just a “question”. Is a “card” what a “question” is referred to as, once it is added to a “dashboard”? OK, lots of ambiguous lingo to wade through. It seems like it worked, the user can now select a date range. That isn’t a pattern that is very re-usable though. When I tried to add an ID filter, rather than displaying the available fileds, the “dashboard” was so helpful by finding exactly one eligible field to select. OK, but what about the next one? It couldn’t find any of the remaining fields in the available data, just kept suggesting the same field no matter how many filters I try to add. Is anyone there?

So, I tried adding a “visualization”. Pretty, but I like the tabular data better. So, all I have to do is click the option again, to de-select, right, like any normal GUI? Wrong! Once you add the chart, there is no way to remove it. None that I can see. The selection control is a “radio button”. The only time no selection is registered, is the first time. You can’t click again, to turn it off. There is a “gear” icon, but when it is selected, the entire “visualization” are just goes blank, except for a “back arrow” icon. HELP!

It would be very helpful if a “question” would display the SQL it is generating. Puzzling over an error message re. ‘syntax near “=”’, but there is no “=” in the “question”. Must be added by the pre-processor. Would expect an “IN”, but not “=”.

Hi @Noah
It’s almost impossible to answer topics like this with so many different types of questions and edited multiple times.
I would highly recommend that you search the forum, when you’re having a specific issue - if you don’t find any new, relevant topics, then create a new topic specifically for that question and anything closely related.

As for being able to see the SQL, that’s possible when using the query browser:
https://www.metabase.com/docs/latest/users-guide/custom-questions.html#viewing-the-sql-that-powers-your-question
If it is a Native question, then you need to view the log of your database. It’s possible to partially see some of the query in the request via your browser developer console.
https://github.com/metabase/metabase/issues/6096 - upvote by clicking :+1: on the first post

Thanks Flamber! My modus operandi is to search documentation first, then the discussion board. I did then start a new topic, but got no response, until now. The second hardest part of finding relevant information is that I may use words that I am familiar with, but others use different terms to describe the same thing. If the “question” actually “ran”, I could indeed review the DB log, if I had admin access. However, I usually have no way to know whether the error message is coming from Metabase, or the DB itself. In this case, I’m pretty sure it is Metabase inserting an “=” where it should use “IN”, for processing a list, rather than a single value. I spent hours trying to find a reference to SQL “IN”, in the docs, and discussion board. That’s the hardest part, searching for answers for words like “IN”.

@Noah

If you posted the full error message, then it’s probably easier to understand where it’s coming from, but almost sure that’s an error from the database.

When having problems with Native queries, then it usually help if you post the actual query.

And it would help if you posted your version too - “Diagnostic Info” from Admin > Troubleshooting.

Yes, you are no doubt 100% correct that the error is coming from the DB.
What I failed to explain clearly, was that when Metabase uses “=” where it should use “IN” for an object comparison, since the value being handled at that point is a list ( sequence of values ), rather than a single value, of course the DB will object. It is the strange way that the DB objects that I am puzzling through. (see error message below)

This works:

where UPC like ‘00000%’
[[ AND ({{dept_number}}) ]]

when the field filter is set is set match against the DEPT column (integer), and the default value is:

123 456 789

It seems that “IN” is applied, with no errors, returning expected results.

This doesn’t work:

where UPC like ‘00000%’
[[ AND ({{dept_number}}) ]]
[[ AND RIGHT(({{upc_alphanum}}), 9) ]]

when the field filter is set match against the UPC column (text), and the default value is:
987654321 123456789 192837465 918273645

Full Error Message: Incorrect syntax near ‘=’.

So, with no ‘=’ to be seen in the “question”, it must be Metabase that is using “=”.

Other “default” values attempted, with same error message:
987654321, 123456789, 192837465, 918273645
(987654321, 123456789, 192837465, 918273645)
‘987654321 123456789 192837465 918273645’
(‘987654321 123456789 192837465 918273645’)
‘987654321’ ‘123456789’ ‘192837465’ ‘918273645’
(‘987654321’ ‘123456789’ ‘192837465’ ‘918273645’)
‘987654321’, ‘123456789’, ‘192837465’, ‘918273645’
(‘987654321’, ‘123456789’, ‘192837465’, ‘918273645’)

Diagnostic Info:
{
“browser-info”: {
“language”: “en-US”,
“platform”: “Win32”,
“userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36”,
“vendor”: “Google Inc.”
},
“system-info”: {
“java.runtime.name”: “OpenJDK Runtime Environment”,
“java.runtime.version”: “11.0.5+10-post-Ubuntu-0ubuntu1.118.04”,
“java.vendor”: “Private Build”,
“java.vendor.url”: “Unknown”,
“java.version”: “11.0.5”,
“java.vm.name”: “OpenJDK 64-Bit Server VM”,
“java.vm.version”: “11.0.5+10-post-Ubuntu-0ubuntu1.118.04”,
“os.name”: “Linux”,
“os.version”: “4.15.0-1057-aws”,
“user.language”: “en”,
“user.timezone”: “Etc/UTC”
},
“metabase-info”: {
“databases”: [
“postgres”,
“sqlserver”,
“redshift”
],
“hosting-env”: “unknown”,
“application-database”: “postgres”,
“run-mode”: “prod”,
“version”: {
“date”: “2020-01-13”,
“tag”: “v0.34.1”,
“branch”: “release-0.34.x”,
“hash”: “265695c”
},
“settings”: {
“report-timezone”: null
}
}
}

@Noah Upgrade to at least 0.34.3 - latest release is 0.35.1
You cannot use Field Filters like that - Metabase control the SQL.
https://www.metabase.com/docs/latest/users-guide/13-sql-parameters.html#the-field-filter-variable-type

And you’re adding parentheses, where there shouldn’t be any.

where UPC like '00000%'
[[ AND {{dept_number}} ]]

If you just want a simple filter like Number, then you have much more control, but that will not have any dropdown selectors.

https://github.com/metabase/metabase/issues/9155 - upvote by clicking :+1: on the first post

I will pass your recommendations for upgrades to the admin ...

Found that example, the one that works as "IN", here:

WHERE 1=1
[[ AND ({{state}}) ]]

I didn't add the parens, but it does work as "IN", with a sequence of values.