Service Portal - sp-typeahead.html

Greg42
Mega Guru

Hi All,

I'm trying to customize a Typeahead Search widget and have come across this line:

typeahead-template-url="sp-typeahead.html"

that mentions a template.

Only place I have found with templates is Angular Providers but everything there is used inline so no luck lucking up there too.

I can't seem to find a place where I could create and use mine - what actually can be used as a template there, ui pages, macros?

Anyone has an idea where are those templates stored or it's another content behind ServiceNow firewall?

Cheers

Greg

4 REPLIES 4

Greg42
Mega Guru

Ha! Found it. Went to table list, typed template and noticed: Angular ng-template sp_ng_template Application File


dvp
Mega Sage
Mega Sage

There is a Angular ng-templates related list in the widget form


find_real_file.png


This is where it is hiding


Daniel Pettet
ServiceNow Employee
ServiceNow Employee

This is the correct answer.



Copy the template and create a new record for your own widget in the related lists. Templates must be loaded by your widget or another. So long as any widget loads the ID/URL you need then it will work.



Ensure to change the ID for your new template as all template IDs must be unique (unique URLs).


Since the IDs are unique, on clone, the reference is lost and the new one needs to be made and the reference to it needs to be updated. Super helpful, thank you!