Getting Data In

in the multiselect input how to give user option to choose AND or OR

surekhasplunk
Communicator

Hi,
I have dynamic users in the input type which i am populating in multiselect
Now i want to give the user the option to choose from AND or OR as sometimes the user want to see values for userA AND userB and sometimes userA OR userB
Is it possible.

As of now i know how to user either one option. How to include both options ?

Tags (2)
0 Karma
1 Solution

renjith_nair
Legend

@surekhasplunk ,

If the logical operator is dynamic, you probably might need to depend on a token to set them dynamically based on user choice.

For e.g, in the below XML, user selects the operation before he selects the user information.

<form>
  <label>MultiSelect</label>
  <fieldset submitButton="false">
    <input type="radio" token="ops">
      <label>Operation</label>
      <choice value="AND">AND</choice>
      <choice value="OR">OR</choice>
      <default>AND</default>
      <initialValue>AND</initialValue>
    </input>
    <input type="multiselect" token="users">
      <label>Users</label>
      <choice value="UserA">UserA</choice>
      <choice value="UserB">UserB</choice>
      <choice value="UserC">UserC</choice>
      <default>UserA</default>
      <initialValue>UserA</initialValue>
      <delimiter>  $ops$ </delimiter>
    </input>
  </fieldset>
  <row>
    <panel>
      <html>
        <h1> $users$</h1>
      </html>
    </panel>
  </row>
</form>

Based on your actual requirement, you may extend it and add additional conditions on the token changes.

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@surekhasplunk ,

If the logical operator is dynamic, you probably might need to depend on a token to set them dynamically based on user choice.

For e.g, in the below XML, user selects the operation before he selects the user information.

<form>
  <label>MultiSelect</label>
  <fieldset submitButton="false">
    <input type="radio" token="ops">
      <label>Operation</label>
      <choice value="AND">AND</choice>
      <choice value="OR">OR</choice>
      <default>AND</default>
      <initialValue>AND</initialValue>
    </input>
    <input type="multiselect" token="users">
      <label>Users</label>
      <choice value="UserA">UserA</choice>
      <choice value="UserB">UserB</choice>
      <choice value="UserC">UserC</choice>
      <default>UserA</default>
      <initialValue>UserA</initialValue>
      <delimiter>  $ops$ </delimiter>
    </input>
  </fieldset>
  <row>
    <panel>
      <html>
        <h1> $users$</h1>
      </html>
    </panel>
  </row>
</form>

Based on your actual requirement, you may extend it and add additional conditions on the token changes.

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

surekhasplunk
Communicator

Thanks for quick help,

I will implement the same in my dashboard!!!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...