The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add filter to service portal

anindya_11
Giga Contributor

Hi,

We have a requirement "As a ESS User on Service Portal, I should be able to filter the the incidents & service Requests that i have raised by Date and State of the ticket. " The filter option is available on self service view but not on service portal. Can anyone help.

5 REPLIES 5

ian_cox
ServiceNow Employee
ServiceNow Employee

Hi, we have done this on our service portal.   Let me get you some help.


jayr
Tera Contributor

Hi Ian,



Could you share what you did please? I have a similar requirement whereby the customer wants to be able to filter a list on the Service Portal in a similar way to how its done in the tool (Using condition builder).



Many thanks!


meetsuresh
ServiceNow Employee
ServiceNow Employee

Hi Aninyda,



Service Portal provides 'Data Table' widget out-of-box to support list functionality.   You can instantiate this as part of your widget and add filters to it


For example in your widget you could something like this.   Filter can be static and can be constructed dynamically from input params.



Server Script:


var widgetParams = {


  table: data.table,


  table_label: input.table_label,


  table_plural: input.table_plural,


  column_labels: input.column_labels,


  .....


  filter: data.filter,


  list: input.list,


  original_list: input.list,


  window_size: gs.getUser().getPreference('rowcount') || 10,


  show_breadcrumbs: input.show_breadcrumbs === false ? false : true,


          hide_header: false,


          show_keywords: input.show_keywords === false ? false : true,


              show_new: false,


          show_title: false


  };



  data.dataTableWidget = $sp.getWidget('widget-data-table', widgetParams);



Html Template:


      <div ng-if="data.dataTableWidget">


      <sp-widget widget="data.dataTableWidget"></sp-widget>


      </div>


Hi suresh.yekollu,



"Filter can be static and can be constructed dynamically from input params."



-> I manage to show the filter but I am struggling to make it static.


How would you proceed to make static?



Regards,



Calliste