Interactive filter on serial number on table alm_hardware

jj44
Tera Contributor

Hello,

I want to filter on a serial number with an interactive filter and it doesn't work? Can you help me?
how to configure the interactive filter? The report is on the alm_hardware table.
Cordially,

find_real_file.png


 

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Hi @JJ 

I doubt that you can add that as a Interactive filter on to your dashboard.

Reason being Serial number on Asset table is a string type of field and OOB as far as I know it does not allow you to select String type of field and should be a Reference field which need to be selected to be used as a Interactive filter.

For these kind of scenario I would recommend that you need to create a Custom interactive filter of your own

https://docs.servicenow.com/bundle/rome-now-intelligence/page/use/dashboards/concept/c_CustomPublishers.html

Let me know if you have a follow up query on this.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

23 REPLIES 23

jj44
Tera Contributor
Hello,
In the tip for interactive filters where to import the XML file, 
I can't find where to import and I don't really know what to modify
in the XML file. And for the second solution otherwise I can't find a
custom interactive filter examples
corresponding to what I wish.

shloke04
Kilo Patron

Hi @JJ 

I doubt that you can add that as a Interactive filter on to your dashboard.

Reason being Serial number on Asset table is a string type of field and OOB as far as I know it does not allow you to select String type of field and should be a Reference field which need to be selected to be used as a Interactive filter.

For these kind of scenario I would recommend that you need to create a Custom interactive filter of your own

https://docs.servicenow.com/bundle/rome-now-intelligence/page/use/dashboards/concept/c_CustomPublishers.html

Let me know if you have a follow up query on this.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

jj44
Tera Contributor

Hello, Is it possible to tell me the code for my personalized filter in my specific case? I will then draw inspiration from it to make the other filters that are related to this same table. Cordially,

This is mentioned in below article on how you should do it:

https://docs.servicenow.com/bundle/rome-now-intelligence/page/use/dashboards/concept/c_CustomPublishers.html

Have you tried anything till now, if yes then please share to assist further.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

jj44
Tera Contributor

😉 Serial number 

find_real_file.png

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

  <div style="display:flex;justify-content:center;">
	  <h4><strong>Numéro de série</strong></h4>

    </div>
	
 <script>
     var my_dashboardMessageHandler = new DashboardMessageHandler("alm_hardware_dashboard");
  
    function searchbySerial_Number (str) {
        var filter_message = {};
        filter_message.id = "alm_hardware_dashboard";
        filter_message.table = "alm_hardware";
    
    <!--     Add your own filter query logic here -->
        filter_message.filter = "serial_numberLIKE" + str;
        SNC.canvas.interactiveFilters.setDefaultValue({
                id: filter_message.id,
                filters: [filter_message]
            }, false);
        my_dashboardMessageHandler.publishFilter(filter_message.table, filter_message.filter);
	     }
 </script>   

  <div style="display:flex;justify-content:center;">
<input id='Serial_Number' type='text' style="width:600px;" value='' onChange='searchbySerial_Number(this.value);'/>
    </div>


</j:jelly>