All Apps and Add-ons

How to give some default value in checkbox Pulldown if nothing is selected

JaideepK
Explorer

I am using a checkbox Pulldown and using

MyValue
a.appId="$value$"

I am using "MyValue" to pass the selected values in the checkbox Pulldown to MYSQL query as an OR condition.

ex: select * from abc wherer name = 'xyz' OR $MyValue$

but the problem is, if no value is selected in the checkbox Pulldown nothing is being passed by $MyValue$ and the query looks as shown below and is not able to execute

ex: select * from abc wherer name = 'xyz' OR

1 Solution

sideview
SplunkTrust
SplunkTrust

You can pull up the "OR " part into the "outerTemplate" param like so:

<param name="outerTemplate">OR ($value$)</param>

and then when there are no terms to output and $MyValue$ dissappears, the OR will disappear with it.

View solution in original post

sideview
SplunkTrust
SplunkTrust

You can pull up the "OR " part into the "outerTemplate" param like so:

<param name="outerTemplate">OR ($value$)</param>

and then when there are no terms to output and $MyValue$ dissappears, the OR will disappear with it.

JaideepK
Explorer

Thank you so much for the fast reply it worked for me....

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...