When I open an existing dashboard that I created, Redash displays the following error message…

“Error running query: missing value for Workstation parameter.”

The “Workstation” parameter is a query drop-down parameter. From the drop-down, I can select one value or multiple.

Questions:

  1. Why am I getting this message?
  2. What is best practice to handle this error? (i.e., do I need to change my query)
  3. How can I change the standard message, “Error running query: missing value for Workstation parameter.” to something more meaningful like… “Please select one or more workstation ids and click apply changes”

Query:
with totalBase as (
SELECT
RegID, count(*) Number of Sales
FROM
jup_nsc_workspace.tbl_saletrans
WHERE RegID in ( {{ Workstation }} )
GROUP BY 1
)
SELECT
*,
sum(Number of Sales) OVER (
ORDER BY (SELECT 1)
) Total Number Of Sales
FROM
totalBase
ORDER BY
2 ASC;

Thanks for your question and welcome to the forum!

Answering your questions by number:

1. Why am I getting this message

Redash expects every parameter will have a default value, but you haven’t saved a default for this parameter. When you load the dashboard Redash eagerly tries to execute all queries on the dashboard. But finding that no parameter value for one- or more queries, it shows you the error.

2. What is best practice to handle this error? (i.e., do I need to change my query)

Yes you can change the query to have a default value. Visit the query, set a parameter value, then save the query.

3. How can I change the standard message

Redash doesn’t allow you to custom override the error message. Two ways you can do this similarly:

Best practice: Use a textbox widget

Add a textbox widget with a header that contains instructions like shown below

Ultra-hacky: set the parameter default to a user-readable string

You can write a query like this:

SELECT
  fields
FROM
  table
WHERE
  'Please select one or more workstation ids and click "Apply Changes"'  in ({{ param }}) OR
  field in ({{ param }})

Then set the default parameter value to a string: Please select one or more workstation ids and click "Apply Changes".

This probably isn’t the right answer but technically it works :wink: