How to create new hire onboarding (lifecycle event) for bulk user

Upender Kumar
Mega Sage

There is a record producer for New hire onboarding with lifecycle event. I have a requirement to create an onboarding lifecycle for multiple users in an excel file.

 

Please help me.

1 ACCEPTED SOLUTION

Upender Kumar
Mega Sage

I found a solution. I cloned the OOB flow in the flow designer for New Hire Onboarding and updated the condition when a record is inserted into the profile table.

View solution in original post

11 REPLIES 11

Community Alums
Not applicable

Hi @Upender Kumar ,

 Could you explain me about this excel sheet please, as how are you planning to use it and how is it related to lifecycle events?

 

Below is the OOB record producer. I want to run the RP with the script. I have all the data in Excel file containing all the fields of RP.

 

UpenderKumar_0-1681838213645.png

 

Sandeep Rajput
Tera Patron
Tera Patron

@Upender Kumar I am assuming the excel you are referring to contains the values e.g. first name, last name etc. and these must be defined as variables on the record producer.

 

In order to create lifecycle event cases in bulk, I would recommend you to create a fix script in Human Resources Lifecycle events scope.

1. As a first step, you would need to parse the excel sheet which can be done using GlideExcelParser here is the reference to a thread which explains this API using an example very well https://www.servicenow.com/community/developer-articles/you-dont-know-sn-apis-glideexcelparser/ta-p/...

 

2. In the second step, you would need to create the records using your record producer programmatically. Unfortunately, CartJS API is of no use in this case as it only works on Catalog Items and not record producer. Here you need to use solution provided by the author in this post https://www.servicenow.com/community/itsm-forum/how-to-trigger-change-workflow-record-producer-from-... here author Daniel A-C has suggested a Script Include for this purpose which will help you to create records via the record producer programmatically. 

 

I hope by joining the pieces together you will be able to create Lifecycle events cases in bulk.

 

Hope this helps.

I have already tried these steps. I am able to parse Excel file. But not able to run the RP with script and create the records as I am able to create with OOB record producer

 

UpenderKumar_1-1681838544489.png