I need to append the query based on the defined variable.
Please let me know whether it is possible in XML or in a search.
I believe the "condition" element should help you handle various input selections. See
You can also check out the form input examples in the Dashboard Examples App
Hope this helps!