Skip to content

Commit 37b5bf2

Browse files
Create onChangeClientscript.js
1 parent b702486 commit 37b5bf2

File tree

1 file changed

+11
-0
lines changed
  • Client-Side Components/Catalog Client Script/Incident Sentiment Detector (Using Simple Word Matching, No AI)

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
function onChange(control, oldValue, newValue, isLoading) {
2+
if (isLoading || !newValue) return;
3+
4+
var ga = new GlideAjax('SentimentAnalyzer');
5+
ga.addParam('sysparm_name', 'getSentiment');
6+
ga.addParam('sysparm_text', newValue);
7+
ga.getXMLAnswer(function(sentiment) {
8+
g_form.addInfoMessage('Sentiment: ' + sentiment);
9+
g_form.setValue('u_sentiment', sentiment);
10+
});
11+
}

0 commit comments

Comments
 (0)