LoginSignup
0
1

More than 3 years have passed since last update.

ServiceNow - テーブルの検索

Posted at

概要
ServiceNowでテーブルを検索する場合は.addQuery()と.addEncodedQuery()がある。
それらで検索する場合は対象にするフィールド名を指定する。
しかし、ServiceNowには全文検索機能もある。

検索キー 説明
IR_AND_QUERY すべての単語と一致
IR_OR_QUERY どれかの単語と一致
IR_AND_OR_QUERY どれかの単語と一致。全部と一致した結果を上に表示

実行例:
ノレッジを検索する

var gr = new GlideRecord('kb_knowledge');
gr.addQuery('IR_AND_OR_QUERY', 'Creating a new user in Mac OS X');
gr.query();

while (gr.next()) {
  gs.print(gr.number+ ': ' + gr.ir_query_score);
}

実行結果:

*** Script: KB0000015: 39
*** Script: KB0000008: 7
*** Script: KB0000033: 5

利用したノレッジ記事
image.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1