- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 04:01 AM
I'm looking for a way to query the open record on the ticket page of service portal, and add an html table of the receivers to a widget. I've tried doing this on the ticket fields widget, and the html widget with no success.
Basically, I have tried querying the current record and storing the receivers in data.rcvrs, then calling that in the body html template but I get nothing. Anyone able to advise?
var currentRequestID = $sp.getParameter("sys_id"); | |
var requestGR = new GlideRecord('TABLE'); | |
requestGR.addQuery('sys_id', currentRequestID); | |
requestGR.query(); |
data.rcvrs = requestGR.receivers+''; |
Then calling {{data.rcvrs}}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 06:10 AM
first..put your styles in css part of the widget.
in HTML part..do something like this. im assuming your data structure is like this.
c.data.rcvrs = [{"name":"Ross","u_department_name":"dinosouers","manager_name":"Mr History"},{"name":"Joey","u_department_name":"food","manager_name":"Mr Pizza"}]
so basically you need array of objects.. objects would contain 3 properties.. name, u_department_name,manager_name(do this inside server script while loop where you are fetching data)
HTML code.
<table>
<tr>
<th>Name</th>
<th>Dept.</th>
<th>Manager</th>
</tr>
<tr ng-repeat="user in c.data.rcvrs">
<td>user.name</td>
<td>user.u_department_name</td>
<td>user.manager_name</td>
</tr>
</table>
(please mark helpful/like/correct if it helps)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 10:57 AM
After some more reading and learning, I have gotten this to work. Thank you very much for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-25-2017 04:03 AM
cool..sorry if i confused you with that 3 array example
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2022 02:12 PM
Creating my own widget for fun and was stuck on this, until I found your comment. Thanks 🙂