Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Widget to display database view in sp portals

instance
Tera Contributor

I have created a database view for timeworked,and case.

I need to show that database view in widget in sp portals, so i created a widget in the server side code i have executed the script but the script is not working ,

 

 

 

 

what changes do i need to do it in widget script?

 

 

 

 

3 REPLIES 3

newhand
Mega Sage

@instance  
Try this.

 

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

 

HTML

 

ng-rpeat="datax in data.problmen"  

{{datax.number}}

Please mark my answer as correct and helpful based on Impact.

According to your suggestions i have changed But the result is coming empty ,3012c.jpg

 

@newhand do i need to change anything in the Query?

what could be the issue how to solve this?

@instance  

Sorry, i wrote a mistake。

 

HTML

 

ng-rpeat="datax in data.problem"  

Please mark my answer as correct and helpful based on Impact.