Dashboards & Visualizations

uncheck automatically the box JOB_numbers by clicking on button '' save ''

fdi01
Motivator

hi.
alt text

I have a dashboard as above, in which I can choose job_number then make updated on the JOB corresponding to job_number.
My problem is: once the updated perform on the job, I love that each time I click on the button '' save '', my JOB change are save and JOB_numbers marks above are uncheck automatically as the scheme below.

alt text

NB: uncheck the JOB_numbers is the real problem that I have at this time because the sauvgarde JOB change is OK.

Tags (1)
0 Karma

jkat54
SplunkTrust
SplunkTrust

Try changing this section of your xml

             <condition match=" '$newstatus$ == Closed'">
               <unset token="TicketNumber1"></unset>
             </condition>

To:

             <condition match="'$newstatus$' == Closed">
               <unset token="TicketNumber1"></unset>
             </condition>

I changed your match very slightly...

0 Karma

NOUMSSI
Builder

Hi,
If Iunderstand you very well, you want that once you've check save box, you want that selected TicketNumbers become automatically uncheck. Is it so?

0 Karma

frobinson_splun
Splunk Employee
Splunk Employee

Hi @fdi01,
Would you be willing to post the XML for your dashboard? For troubleshooting, it could be helpful to see how it is set up to handle various inputs and actions.
Thanks,
@frobinson_splunk

0 Karma

fdi01
Motivator

this is a XML example

<form script="custom.js">
  <label>NEW TICKET NEW PAGE DRILLDOWN</label>
  <fieldset submitButton="false">

  </fieldset>
  <search>
    <query>$save$</query>
  </search>

  <row>
    <panel>
      <html>
        <h3 style="color:green;text-align:center"> IF YOU WANT TO UPDATE A JOB_Numbers FROM THIS PAGE, YOU CAN DIRECTLY SET NEW VALUES BELOW  </h3> 
    </html>
    </panel>
  </row>
  <row>
    <panel>
      <input type="checkbox" token="TicketNumber1" searchWhenChanged="true">
        <label>check JOB_Numbers you want update</label>
        <!-- The final value will be surrounded by prefix and suffix -->
        <prefix>(</prefix>
        <suffix>)</suffix>
        <!-- Each value will be surrounded by the valuePrefix and valueSuffix -->
        <valuePrefix>TicketNumber="</valuePrefix>
        <valueSuffix>"</valueSuffix>
        <!-- All the values and their valuePrefix and valueSuffix will be concatenated together with the delimiter between them -->
        <delimiter> OR </delimiter>
        <search>
          <query>index=_internal|stats c by sourcetype|rename sourcetype as TicketNumber </query>
        </search>
        <fieldForLabel>JOB_Number</fieldForLabel>
        <fieldForValue>TicketNumber</fieldForValue>
      </input>
    </panel>
    <panel>
      <title>Update:  generate by  JOB_NUMBER</title>
      <input type="text" token="TicketNumber1" searchWhenChanged="true">
        <label>JOB_Number</label>
        <default></default>
      </input>
      <input type="text" token="comment2" searchWhenChanged="true">
        <label>Update the comment</label>
      </input>
      <input type="dropdown" token="newstatus" searchWhenChanged="true">
        <label>Change the JOB status Update:</label>
        <choice value="Open">Open</choice>
        <choice value="Closed">Closed</choice>
        <choice value="In progress">In progress</choice>
        <default></default>
      </input>
      <input type="checkbox" searchWhenChanged="true">
        <label>Save your changes</label>
        <choice value="+ 2">save</choice>
        <default></default>
        <change>
          <condition value="*">
            <set token="save">index=_internal $TicketNumber1$
              |eval status="$newstatus$"   |eval TicketNumber="$TicketNumber1$"         
              |eval Comments="$comment2$" |table TicketNumber status Comments
           |collect index=ticket marker="report=\"ticket1\""</set>
            <condition match=" '$newstatus$ == Closed'">
              <unset token="TicketNumber1"></unset>
            </condition>

          </condition>
        </change>
      </input>
      <table>
        <title>JOB UPDATE</title>
        <search>
          <query>index=_internal $TicketNumber1$
              |eval status="$newstatus$"   |eval TicketNumber="$TicketNumber1$"         
              |eval Comments="$comment2$" |table TicketNumber status Comments 
          </query>
        </search>
        <option name="wrap">true</option>
        <option name="rowNumbers">false</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">row</option>
        <option name="count">5</option>
      </table>
    </panel>
  </row>
</form>

frobinson_splun
Splunk Employee
Splunk Employee

Thanks--could you comment on how the custom.js script you are loading at top of this XML might handle/manage the behavior of the dashboard? If you can post the script or describe it, that would be helpful.

0 Karma

fdi01
Motivator

custom.js script is use to make the discretbar chart on my dashbord.
thx.

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

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...