User Profile Widget loads "default" view rather than "service portal" view

dwoods
Giga Contributor

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
find_real_file.png

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

 

8 REPLIES 8

Kieran Anson
Kilo Patron

Hi,

What was the original widget? Sounds like you're using the 'form' widget?

It was the widget under the service portal options.

find_real_file.png

Are you able to attach a picture/screenshot of your portal? That widget doesn't take a view specification but instead has set fields defined to render.

find_real_file.png

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]);
	}

 

find_real_file.png

 

Thanks