- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-19-2017 06:20 AM
Dear All,
I am very new to service portal. Please let me know how to populate short description along with the number when searched in the homepage search widget of a service portal ?
For example. if I give INC039.... , it should populate all the incidents stating with INC039... alond with the short description placed beside the incident number.
It should be applicable for REQ, KB, TASK etc also.
I appreciate all the help from you.
Regards,
Sumana
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-02-2018 02:53 AM
Hi Sumana,
You need to create a scripted Data Source for the Incidents. In the scripted Data Source add
(function(query) {
var results = [];
//Here goes the logic. Compute results however you want!
if (!gs.isLoggedIn())
return results;
var inc = new GlideRecordSecure('incident');
inc.addQuery('123TEXTQUERY321', query);
inc.addQuery('active',true);
inc.addQuery('no_search', '!=', true);
inc.addQuery('caller', gs.getUserID());
inc.query();
var RowCount = 0;
while (inc.next() && RowCount < data.limit) {
var item = {};
item.type = "inc";
item.page = "ticket";
$sp.getRecordDisplayValues(item, inc, 'number,short_description');
item.score = parseInt(inc.ir_query_score.getDisplayValue());
item.label = item.number;
item.desc=item.short_description;
item.primary = item.number;
item.id=item.sys_id;
item.url = '?id=' + item.page +'&table=incident'+'&sys_id=' + inc.getUniqueValue();
results.push(item);
RowCount++;
}
return results;
})(query);
In this article you will find how can you use the Advance Typeahead Template to put whichever fields you want to dsplay
Create an advanced typeahead template
Create the advance typeahead template -
<span ng-bind-html="match.label | uibTypeaheadHighlight:query"></span>
<span ng-bind-html="match.model.short_description | uibTypeaheadHighlight:query"></span>
Please note the text marked in BOLD in both scripts, In this way you add whichever field you want to display.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2018 12:39 AM
Can you paste the scripted source and the advance type ahead template here ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2019 03:10 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2019 01:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2018 01:54 AM
Hi Eivind,
Yes, even that works.