Custom values in a linked variable

So I have 1 variable right now that is a text box, but I want to have a unique value set when it is empty. Also, because of how I am specifically using it, it needs to be in a separate variable. I am using these variables inside of a Lucene query on ES. Right now it looks like query_var:*${dashboard_var1}*. The issue is that sometimes query_var doesn’t exist in a document (intended behavior), so when dashboard_var1 has nothing selected I want to include all of the documents. The best way I found to do this is with (query_var:*${dashboard_var1}* OR (NOT _exists_:query_var)). If I have that as the query, then it will always pull the documents where query_var doesn’t exist, but I only want to get it when dashboard_var1 has no value. Is there a way to create a second variable dashboard_var2 such that when dashboard_var1 has no value the value of dashboard_var2 will be OR (NOT _exists_:query_var and otherwise dashbaord_var2 will be an empty string?