How to Add a user and user skills in a skills management ?

varma2
Mega Sage

Hi All,

 

We have data on excel sheet it contains users and user skills, I need to import that data under the  skill management module.

Please help me how can i able to achive.

 

Thanks,

Varma

3 REPLIES 3

Sulabh Garg
Mega Sage
Mega Sage

Hello

I believe there ae two tables "cmn_skill" and "sys_user_has_skill".

'cmn_skill' table stores the Skill information and 'sys_user_has_skill' stores the user information and link to the skill in 'cmn_skill' table.

If you have the skill and user information in one excel sheet. You can follow below steps

1) Create one data source on "cmn_skill" and attach the excel sheet on the data source.

2) Create transform map and field mapping related to skill information.

3) Create on-after transform script to create user records in 'sys_user_has_skill' table and link with the 'cmn_skill' table. (This script with run after each tranformation)

find_real_file.png

 

Hope it helps!!

 

Please Mark Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

Hi Sulabh,

Thanks for the reply.

 

Could you please provide the on-after transform script to create user records.

 

we have a already existing data on cmn_skill table and we need to import data on sys_user_has_skill table this table contain USERS AND SKILLS AND SKILL LEVEL.

 

I have import data onsys_user_has_skill, Its showing all records but also its creating duplicate record,

Please help.

Thanks,

Hari

You can write the script as below

 

var grSUHS = new GlideRecord('sys_user_has_skill');
grSUHS.initialize();
grSUHS.user = source.<User Id>; //mention user id from import set table
grSUHS.skill = source.<skills>; //mention Skills from import set table
grSUHS.skill_level = source.<skilllevel>; //mention Skills level from import set table
grSUHS.insert();
 
 To avoid duplicate records, first check if user record already existed or not and then Insert the record.
 

Hope it helps!!

Please Mark Correct/helpful, if applicable, Thanks!! 

Regards

Sulabh Garg

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg