- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 08:13 AM
Hello,
I am working on an onboarding process where I have created my own Lifecycle Event, Record Producer, and an HR Service to trigger my Lifecycle Event. I went ahead and added my HR Service in the client include script so that my new user will be automatically created. I have my user being created but my user ID field is not being populated for some reason. I am not sure if there is somewhere in the script I need to specify that since I am not using the demo provided. Please advise how to get that populated.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:45 AM
@mlamin The entire implementation of the sample onboarding lifecycle event shared by ServiceNow is nothing short of quagmire. I started looking into the user id creation process and after exploring dozens of OOTB script includes like hr_CaseUtils, hr_ActivityUtils, hr_Profile, hr_ServicesUtils, finally came to know that the process of account/user generation depends on two changes.
1. Addition of hr_service value in hr_CaseUtils (This step was already done by you)
this._requiresUserOrProfileCreation = {
'request_onboarding':'',
'new_hire_journey':''
};
2. Addition of Account Notification activity inside your first activity set in the lifecycle event.
If you open this activity, you will find the details.
A workflow works on top of this HR Service which is responsible for creating the User account.After opening this workflow you would find an activity responsible for generating the login information for the new hire.
Here is the script include used in the process.
In your case, you might not have added the Account Notification Activity with Account notification HR Service due to which the user id and profile may not be getting generated for your new hire.
I recommend you to add this this activity inside your first activity set in your lifecycle event.
Here is another good read on the same topic https://www.servicenow.com/community/hrsd-forum/hr-lifecycle-events-cases-how-user-is-created-when-s...
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 08:24 AM
Hello @mlamin ,
can you please post the script that you are using ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 08:29 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2023 11:45 AM
@mlamin The entire implementation of the sample onboarding lifecycle event shared by ServiceNow is nothing short of quagmire. I started looking into the user id creation process and after exploring dozens of OOTB script includes like hr_CaseUtils, hr_ActivityUtils, hr_Profile, hr_ServicesUtils, finally came to know that the process of account/user generation depends on two changes.
1. Addition of hr_service value in hr_CaseUtils (This step was already done by you)
this._requiresUserOrProfileCreation = {
'request_onboarding':'',
'new_hire_journey':''
};
2. Addition of Account Notification activity inside your first activity set in the lifecycle event.
If you open this activity, you will find the details.
A workflow works on top of this HR Service which is responsible for creating the User account.After opening this workflow you would find an activity responsible for generating the login information for the new hire.
Here is the script include used in the process.
In your case, you might not have added the Account Notification Activity with Account notification HR Service due to which the user id and profile may not be getting generated for your new hire.
I recommend you to add this this activity inside your first activity set in your lifecycle event.
Here is another good read on the same topic https://www.servicenow.com/community/hrsd-forum/hr-lifecycle-events-cases-how-user-is-created-when-s...
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2023 06:50 AM
Thank you! This resolved my issue.