serviceportal avatar

scottl
Kilo Sage

I'm getting a blank icon as an avatar in my "custom portal".   No initials, no photo.   In the admin area of ServiceNow it shows as expected, just not in service portal top menu.

It works in the "[instance].service-now.com/sp" portal fine too.   So it seems that there's code somewhere that needs to be called in, into this new custom portal.

<sn-avatar class="avatar-small-medium" primary="userID" />

And where is the code/widget above stored for this so it can be debugged? As it also calls this method "avatarType()", where is this being set?

1 ACCEPTED SOLUTION

scottl
Kilo Sage

Update: Found out that the attribute value must be set in the controller, which was missing.



[View]


<sn-avatar class="avatar-small-medium" primary="userID" />



[Controller]


$scope.userID = $scope.user.sys_id;



The naming convention for variables being passed into the view, differs from the model, and how that attribute "primary" is written as a string was overlooked as a $scope variable declared in the controller.



The mystery of "out of the box" widgets and what happens within them.


View solution in original post

3 REPLIES 3

scottl
Kilo Sage

Update: Found out that the attribute value must be set in the controller, which was missing.



[View]


<sn-avatar class="avatar-small-medium" primary="userID" />



[Controller]


$scope.userID = $scope.user.sys_id;



The naming convention for variables being passed into the view, differs from the model, and how that attribute "primary" is written as a string was overlooked as a $scope variable declared in the controller.



The mystery of "out of the box" widgets and what happens within them.


Hi, have observed something, if a user is created with first last name and later the names are changed, the system does not seems to display the correct Initials in the ServicePortal. The Backed seems to be fine


That is likely because the profile is duplicated into `live_profile`. The user avatar seems to be generated based on the name in `live_profile`, so it should be updated when `sys_user` is.