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 hide search box on List Collector for a catalog item?

rexter1
Tera Expert

Hello guys,

Could you give me any idea, preferely an onLoad client script, which could hide the search field on a List collector?

See screenshot. "No_filter" attribute is good to remove the filter, but I want to remove that search box also. Thanks!

 

find_real_file.png

 

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

You need to use DOM manipulation. Right click the field something as below & then select inspect.

 

find_real_file.png

 

Look for the id

find_real_file.png

 

& then use it in onLoad() client script with below snippet.

function onLoad() {
   //Type appropriate comment here, and begin script below
  document.getElementById('replace_it_with_id_you_get').style.display="none"; 
}

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

View solution in original post

4 REPLIES 4

Roger Poore
Tera Guru

Use your browser's object inspector and find the name/class of that search box.  Then use $("#searchBoxThingy").hide(); in your script.  I haven't tried but it seems like it would work.

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

You need to use DOM manipulation. Right click the field something as below & then select inspect.

 

find_real_file.png

 

Look for the id

find_real_file.png

 

& then use it in onLoad() client script with below snippet.

function onLoad() {
   //Type appropriate comment here, and begin script below
  document.getElementById('replace_it_with_id_you_get').style.display="none"; 
}

 

Thanks,

Jaspal Singh

 

Hit Helpful or Correct on the impact of response.

Thank you! it worked. The final solution was to remove both "search" id lines

document.getElementById('u_data_type_select_0_search_row').style.display="none";

document.getElementById('u_data_type_select_1_search_row').style.display="none";

Gracie2
Kilo Contributor

Hi, I  know this is an old post, but do you know how i can make this work in Onchange client script?

The variable visibility is dependent to another variable.

Thanks