Well this is pretty straightforward in Sideview Utils, but you can also do this without much trouble just using the default Splunk Dashboard editor.
Here's how to do it in hand-edited Sideview XML.
<module name="TextField" layoutPanel="panel_row1_col1">
<param name="name">to</param>
<param name="label">to:</param>
<module name="TextField">
<param name="name">subject</param>
<param name="label">subject:</param>
<module name="Button">
<param name="allowSoftSubmit">True</param>
<module name="Search">
<param name="search">foo | sendemail $address$ $subject$ </param>
<module name="JobProgressIndicator"></module>
</module>
</module>
</module>
</module>
If you're using the Sideview Editor you would click and edit your way to the above hierarchy.
Be sure to read the first few introductory documentation pages within the Sideview Utils app, and then also read the TextField docs and examples page. That'll give you enough to understand this simple view, and then you can expand out to the other UI modules and their docs and examples pages.
But again, in this (really very simple) use case you can also just use core Splunk UI features - in brief, add a search to a dashboard panel, edit the panel, and then click "add input", and read a bunch of Splunk docs about how to then parametrize your search with $foo$ tokens.
... View more