Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 05:58 AM
Hello All, Can you please help me with this code; i am new to widgets.
its not showing the value in HTML div. what did i miss....
Html :-
<input type="text" ng-model="c.data.inc" class="form-control" aria-label="...">
<button type="submit" ng-click="c.searchD()" class="btn btn-primary">Search Incident</button>
<div ng-repeat = "key in data.arr">
{{key.short_description}} => Why is this not displaying any values;
</div>
Client Script:-
api.controller=function() {
var c = this;
c.searchD = function (){
c.server.update();
}
}
Server Script:-
(function() {
data.arr=[];
if(input){
var gD = new GlideRecord('incident');
gD.addQuery('number',input.inc);
gD.query();
while(gD.next()){
var v ={};
v.short_description = gD.short_description;
data.arr.push(v);
console.log(v.short_description); >> This is showing the value
}
}
})();
Solved! Go to Solution.
1 ACCEPTED SOLUTION
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 09:34 AM
Hi @David Cross ,
You will need to pass the value of the short description to html using "getValue()".
Please update your server side script to below code -
(function() {
data.arr = [];
if (input) {
var gD = new GlideRecord('incident');
gD.addQuery('number', input.inc);
gD.query();
while (gD.next()) {
var v = {};
v.short_description = gD.getValue('short_description');
data.arr.push(v);
}
}
})();
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 09:34 AM
Hi @David Cross ,
You will need to pass the value of the short description to html using "getValue()".
Please update your server side script to below code -
(function() {
data.arr = [];
if (input) {
var gD = new GlideRecord('incident');
gD.addQuery('number', input.inc);
gD.query();
while (gD.next()) {
var v = {};
v.short_description = gD.getValue('short_description');
data.arr.push(v);
}
}
})();