In the User profile page in portal i want to add a select option for editing the country. Any solutions please

jobik
Kilo Explorer

In the portal for the User profile widget, we are using below OOB code for adding displaying the Department and Location. Now as per the requirement, need to have a feasibilty to show the country and need to update it back to the user profile. Iam able to display the Choice value using angular..but to make it editable and update the user table is not happening. No idea about wat the tag sp-editable-field does..

Please suggest some ideas for resolving the same.

<p ng-if="::displayField('sys_user', 'department', true)"><strong class="pad-right">${Department}</strong><sp-editable-field editable-by-user="data.isLoggedInUsersProfile" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.department"></sp-editable-field></p>

                      <p ng-if="::displayField('sys_user', 'location', true)"><strong class="pad-right">${Location}</strong><sp-editable-field table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.location"></sp-editable-field></p>

    <p ng-if="::displayField('sys_user', 'title', true)" ><strong class="pad-right">${title}</strong>

                            <sp-editable-field editable-by-user="data.isLoggedInUsersProfile" table="sys_user" table-id="data.sysUserID" field-model="data.sysUserModel.title"></sp-editable-field></p>

  Our Custom code

<select     class="form-control input-sm"><option ng-repeat="cat in data.countryList" value="{{ cat }}">{{cat}}</option> </select>

1 ACCEPTED SOLUTION

marcguy
ServiceNow Employee
ServiceNow Employee

the way I added it to the user profile widget was just to add the field to the backend view in the user form, i.e. go to a user record in the back end, change your view to 'Service Portal' then add the country field, after that I was able to edit it as long as My Access Control rules were set to allow the user to edit it as well.


View solution in original post

2 REPLIES 2

marcguy
ServiceNow Employee
ServiceNow Employee

the way I added it to the user profile widget was just to add the field to the backend view in the user form, i.e. go to a user record in the back end, change your view to 'Service Portal' then add the country field, after that I was able to edit it as long as My Access Control rules were set to allow the user to edit it as well.


yes. Right. I tried it. Added the field in the Portal view in User table, and then modified the code for adding the country code.



Thanks,


Jobi K