via script Tool , how to lookup for the data in the attachement of the KB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Bellow is the script tool which i wrote and it works perfectly fine to extract the information from a kb article, however sometime i am not able to get the requested information from the KB article which has an attachment ( PDF, word, csv, excel):
can someone please assist, how to extract information from kb article which has an attachment ( PDF, word, csv, excel).
Script inputs
Input name
| Description |
number | Knowledge article number |
Script:
(function(inputs) {
// only string inputs are allowed
// return outputs object where the keys in it are understandable by LLM
// Retrieve KB article
var kb_gr = new GlideRecord('kb_knowledge');
kb_gr.addQuery('number', inputs.number);
kb_gr.orderByDesc('version');
kb_gr.setLimit(1);
kb_gr.query();
if (kb_gr.next()) {
return kb_gr.text.toString();
} else {
throw new Error('No KB found with number ' + inputs.number);
}
})(inputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
See if this heslps you . You Can tweak it as per ur need.
Regards
RP
