Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to add the search box on the Data Table from Instance Definition Widget

ritaaudi
Tera Contributor

Hi: Anyone know how to add the search box on the Data Table from Instance Definition Widget as it exists on the Data Table from URL Definition widget:

find_real_file.png

1 ACCEPTED SOLUTION

chirag_bagdai
ServiceNow Employee
ServiceNow Employee

Hi Rita,



If you want to use search functionality through Data Table From Instance Definition Widget, you need to clone this widget and add widget parameter (show_keywords: true),   per below screenshot :


Screen Shot 2017-06-03 at 5.48.44 PM.png


View solution in original post

5 REPLIES 5

ChrisBurks
Giga Sage

Hi Rita,



There are a couple of ways you can do this. But the core thing that will make the search box display is by setting the option "search_keyword" to true for the "Data Table" widget. That is the widget that both "Data Table from Instance Definition" and "Data Table from URL Definition" are embedding. In the "Data Table from URL Definition" widget you'll notice that in the server-side script when it's defining the widget to embed - in the options it's passing and setting search_keywords to true.


set_search_keywords.png



Looking in the "Data Table" widget html markup you can see the ng-if condition set on the containing div to display if options.show_keywords is true


show_search_if_true.png


chirag_bagdai
ServiceNow Employee
ServiceNow Employee

Hi Rita,



If you want to use search functionality through Data Table From Instance Definition Widget, you need to clone this widget and add widget parameter (show_keywords: true),   per below screenshot :


Screen Shot 2017-06-03 at 5.48.44 PM.png


Gopi22
Tera Guru

Hi Chris/Chirag, 

I am trying to add a search box on my Data Table from Instance Definition widget 

Table selected is sysapproval_approver

The widget is displaying the approval requests which are on 'Requested' stage for the logged in user.

User should be able to type in the request number on the search box and on submit it should either display that request in the list below or take them directly to the approval page of that request. 

Also, if it is achievable through any other widget, suggest that as well.

Please provide your inputs on this.

 

 

Thanks,

Gopi

ashi7
Kilo Contributor
Hi, i am looking for same. Please let me know if you get this working