User Profile Widget loads "default" view rather than "service portal" view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2021 02:54 PM
I am having an issue with certain users always seeing the default view when viewing the user profile widget in the service portal. Other users look to be seeing the service portal view.
I have tried loading these users with query parameters v= and view= and still no luck.
I tried cloning the widget and I did a Json.Stringify() and the object says its the service portal view.
var sysUserForm = $sp.getForm(data.table, data.sysUserID);
data.sysUserView = sysUserForm._view;
gs.addInfoMessage('user profile view is ' + JSON.stringify(sysUserForm));
output looks like this
Any way I can force this service portal view in the code? Only other option I see is in the client script is to add the list of fields I want to make sure are hidden in the field_excludes array. This isn't ideal as I would like to use the form designer to set certain fields as read only as well.
Thanks
- Labels:
-
Service Portal Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2021 04:01 PM
Hi,
What was the original widget? Sounds like you're using the 'form' widget?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2021 10:34 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2021 12:51 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2021 01:58 PM
Interesting. In the script it seems to loop over a views field set.
data.isLoggedInUsersProfile = loggedInSysUserID.equals(data.sysUserID);
var sysUserForm = $sp.getForm(data.table, data.sysUserID);
data.sysUserView = sysUserForm._view;
data.sysUserModel = sysUserForm._fields;
data.sysUserModelList = [];
for (var i = 0; i < data.sysUserView.length; i++) {
data.sysUserModelList.push(data.sysUserModel[data.sysUserView[i].name]);
}
Thanks