Author > Creating questions and responses > Question type overview > Creating database questions > Filter dialog
 
Filter dialog
The Filter dialog allows you to write mrScript that can be used to further filter the response list returned from the database (via the Script tab), or compose SQL Where clauses in the provided WHERE section.
Depending on whether you are editing from the Routings pane (script) or the Questions pane (metadata), the SQL and Script tabs are available.
Only the SQL tab is available when editing from the Questions pane (metadata). You can compose your SQL Where clause in the provided WHERE section.
Both the SQL and Script tabs are available when editing from the Routings pane (script). You can write mrScript that can be used to further filter the response list returned from the database in the Script tab.
Notes
There are some limitations when editing mrScript directly in the Base and Script tabs. The limitations are the result of the In operator, which is not supported when customizing filter strings. For example, the following string would be blocked by the SQL validation logic:
MakeID in ('Audi', 'BMW')
You could modify the string, by removing the In operator, to something like the following:
MakeID = 'Audi'
or
MakeID = 'BMW'
You can provide support for the In operator by turning off database question filter validation. For example:
Mdmdoc.EnableDBQuestionFilterValidation = false
The property can be changed in Metadata Model Explorer, via the properties list pane, when you select the Document node in the left tree. You can also change the property in UNICOM Intelligence Professional by adding the following in the metadata section header:
DBQuestionFilterValidation = false
Turning off database question filter validation is not recommended as it may result in SQL injection issues.
See also
Creating database questions