- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2024 02:27 PM
Hello, Friends!
I want to know how I can find the documentation about the "sn-avatar", the example code is:
<sn-avatar class="avatar-medium" primary="user.user_id"></sn-avatar>
I want to implement a user's list with your picture/avatar in the Service Portal, but just appears their initials and I really want to know how the <sn-avatar> works.
HTML Template:
<thead>
<tr>
<th>Photo</th>
<th>No.</th>
<th>Name</th>
<th>User ID</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in data.users">
<td>
<sn-avatar class="avatar-medium" primary="user.user_id"></sn-avatar>
</td>
<td>{{user.no}}</td>
<td>{{user.name}}</td>
<td>{{user.user_id}}</td>
</tr>
</tbody>
Server Script:
(function () {
var user_rec = new GlideRecord("sys_user");
user_rec.setLimit(10);
user_rec.query();
data.users = [];
var count = 1;
while (user_rec.next()) {
var user = {};
user.no = count++;
user.name = user_rec.getDisplayValue("name");
user.user_id = user_rec.getValue("user_name");
data.users.push(user);
}
})();
Preview:
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2024 10:44 PM
Hi,
Link to avatar documentation - https://developer.servicenow.com/dev.do#!/reference/next-experience/washingtondc/now-components/now-...
If this helps please mark as helpful.
Thanks,
Sravani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2024 10:44 PM
Hi,
Link to avatar documentation - https://developer.servicenow.com/dev.do#!/reference/next-experience/washingtondc/now-components/now-...
If this helps please mark as helpful.
Thanks,
Sravani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2024 06:10 AM
I don't understand why the attributes are different from each other.
But seriously, thanks for the information. I sorted it out and found these links yesterday. There was a problem with the "image-src" attribute.