- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 01:01 AM
Hi All ,
We have build some custom field in Hr profile and User profile. We have requirment when in case HR pofile get some field update same field need to sync with User table .I have checked there is OOB BR (Synchronize fields to sys_user) and SI (hr_Synchronize and hr_Utils ) is there but there nothing to mapping. so cusome filed update in HR profile same field can update in User table.
Can any one suggested how to do to sync with HR profile and user table ?
Solved! Go to Solution.
- Labels:
-
HR Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 02:16 AM
Hi,
The BR invokes script include hr_Synchronize and function syncRecord
In that syncRecord function update the new field with your destination field and run once
The part in bold is newly added; Ensure you give correct field names from both the tables
var profileMap = {
'address': { 'destField': 'street' },
'country': { 'destField': 'country', 'func': this._mapProfileField },
'position': { 'destField': 'title', 'func': this._mapProfileField },
'source': { 'destField': 'hr_integration_source' },
'u_custom_profile_field': { 'destField': 'u_user_field' }
};
Similarly if you want sync to happen from User -> HR Profile
then update the else section like this
var userMap = {
'country': { 'destField': 'country', 'func': this._mapUserField },
'hr_integration_source': { 'destField': 'source' },
'street': { 'destField': 'address' },
'title': { 'destField': 'position', 'func': this._mapUserField },
'u_user_field': { 'destField': 'u_custom_profile_field' }
};
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 01:52 AM
If it is a custom field updated directly on HR Profile table why not create a new business rule instead of altering OOB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 02:16 AM
Hi,
The BR invokes script include hr_Synchronize and function syncRecord
In that syncRecord function update the new field with your destination field and run once
The part in bold is newly added; Ensure you give correct field names from both the tables
var profileMap = {
'address': { 'destField': 'street' },
'country': { 'destField': 'country', 'func': this._mapProfileField },
'position': { 'destField': 'title', 'func': this._mapProfileField },
'source': { 'destField': 'hr_integration_source' },
'u_custom_profile_field': { 'destField': 'u_user_field' }
};
Similarly if you want sync to happen from User -> HR Profile
then update the else section like this
var userMap = {
'country': { 'destField': 'country', 'func': this._mapUserField },
'hr_integration_source': { 'destField': 'source' },
'street': { 'destField': 'address' },
'title': { 'destField': 'position', 'func': this._mapUserField },
'u_user_field': { 'destField': 'u_custom_profile_field' }
};
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 03:30 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2022 03:39 AM
Just to check would it be recommended to update OOB script include