Query in script include

devservicenow k
Tera Contributor

I have created a database view and i need this database view to be shown in the widgets of the SP portals. 

3012b.jpg

On creating a Script include in the widget editor the database view is not seen in the sp portals.

 

Script include:

 

(function() {
data.problem=[];
var gr =new GlideRecord('u_casecasetask');
//gr.addEncodedQuery('cs_account=a783960397e711104ff5bd3ef053afa5');
//gr.query();
while (gr.next())
{
var datax ={};
//datax.number =gr.getValue('tw_task');
datax.number=gr.getDisplayValue('tw_task');
//datax.number =gr.tw_task.tk_number;
data.problem.push(datax);
}
})();

 

on executing this script the record is not seen how to solve this? 3012c.jpg

help me with script

1 ACCEPTED SOLUTION

jaheerhattiwale
Mega Sage
Mega Sage

@devservicenow k Its typo error. problem spelling is wrong in html

jaheerhattiwale_0-1672378380793.png

 

Use correct variable name as defined in the server script.

 

Please mark as correct answer if this solves your issue.

 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

3 REPLIES 3

jaheerhattiwale
Mega Sage
Mega Sage

@devservicenow k Its typo error. problem spelling is wrong in html

jaheerhattiwale_0-1672378380793.png

 

Use correct variable name as defined in the server script.

 

Please mark as correct answer if this solves your issue.

 

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

@jaheerhattiwale  i have changed and checked it still it is not showing the records 

 

is any problem with the query?

@devservicenow k ng-repeat spelling is also wrong. Fix that and check.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023