I have a dashboard and at the top I would like to display a horizontal selection for the user, such that they can select report A, report B, or report C. When they click it, it will open the report in a new window.
This can be accomplished through 3 checkboxes, radio buttons, HTML link, etc. I'm not sure how to do this. I thought radio buttons, so I can start them all as unset, then when a user selects one, it unsets the other two and then opens a window with the report but am lost how to accomplish this. Any pointers would be appreciated.
Ideally you should use a Link input (Radio and even Check Box should also work on similar lines)
Following is a snippet for Link Inputs which can serve as links to separate dashboards (you need to provide the dashboard path relative/absolute depending on your use case).
Please try out and confirm!
<dashboard>
<label>Link Inputs</label>
<row>
<panel>
<html depends="$alwaysHideCSSOverride$">
<style>
div[id^="link_"] button{
width: 180px !important;
background: rgb(92,192,92,1);
padding: 10px;
border-radius: 10px;
color: white !important;
}
</style>
</html>
<input id="link_1" type="link" token="tokLink1" searchWhenChanged="true">
<label></label>
<choice value="link1">Link 1</choice>
<change>
<condition value="link1">
<link target="_blank">yourLink1PathGoesHere</link>
<unset token="form.tokLink1"></unset>
</condition>
</change>
</input>
<input id="link_2" type="link" token="tokLink2" searchWhenChanged="true">
<label></label>
<choice value="link2">Link 2</choice>
<change>
<condition value="link2">
<link target="_blank">yourLink2PathGoesHere</link>
<unset token="form.tokLink2"></unset>
</condition>
</change>
</input>
<input id="link_3" type="link" token="tokLink3" searchWhenChanged="true">
<label></label>
<choice value="link3">Link 3</choice>
<change>
<condition value="link3">
<link target="_blank">yourLink3PathGoesHere</link>
<unset token="form.tokLink3"></unset>
</condition>
</change>
</input>
</panel>
</row>
</dashboard>
Ideally you should use a Link input (Radio and even Check Box should also work on similar lines)
Following is a snippet for Link Inputs which can serve as links to separate dashboards (you need to provide the dashboard path relative/absolute depending on your use case).
Please try out and confirm!
<dashboard>
<label>Link Inputs</label>
<row>
<panel>
<html depends="$alwaysHideCSSOverride$">
<style>
div[id^="link_"] button{
width: 180px !important;
background: rgb(92,192,92,1);
padding: 10px;
border-radius: 10px;
color: white !important;
}
</style>
</html>
<input id="link_1" type="link" token="tokLink1" searchWhenChanged="true">
<label></label>
<choice value="link1">Link 1</choice>
<change>
<condition value="link1">
<link target="_blank">yourLink1PathGoesHere</link>
<unset token="form.tokLink1"></unset>
</condition>
</change>
</input>
<input id="link_2" type="link" token="tokLink2" searchWhenChanged="true">
<label></label>
<choice value="link2">Link 2</choice>
<change>
<condition value="link2">
<link target="_blank">yourLink2PathGoesHere</link>
<unset token="form.tokLink2"></unset>
</condition>
</change>
</input>
<input id="link_3" type="link" token="tokLink3" searchWhenChanged="true">
<label></label>
<choice value="link3">Link 3</choice>
<change>
<condition value="link3">
<link target="_blank">yourLink3PathGoesHere</link>
<unset token="form.tokLink3"></unset>
</condition>
</change>
</input>
</panel>
</row>
</dashboard>
I have never heard of link inputs before! Can you share a docs/page I can reference to read up more on these? This worked perfectly!
@DEADBEEF what do you mean by not working? The link input behaviour or CSS Style override to make it appear as button?
There is a know issue and fix fir CSS Style override from Simple XML dashboard code. Please refer to answer https://community.splunk.com/t5/Dashboards-Visualizations/How-to-include-CSS-in-Dashboards-with-the-...
Do upvote the answer/comments that helped.
Ahh okay, putting <p/> before the <style> fixed it! Thank you. Maybe edit your answer to use that for the affected versions of splunk?