interview questions on import sets

Snow Guest
Tera Contributor

Questions and interview based scenarios on import sets topics?

6 REPLIES 6

@Manikanta.K 

Did my reply answer your question?

Would you mind marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Community Alums
Not applicable

In interview you have to tell this scenarios

Import data into user table using import set, when inserting data, we need to set userid and password at run time. Userid and password fields should not be present in the file. (UserID – corp/firstname.lastname, Password – pwd@+”1st letter of the name”+$”last letter of the lastname”, Eg – first name – abc, last name- pqr then password will be pwd@a$r)(Excel File Col – Firstname, Lastname, Email id) 10 user in files.

 

Firstly we have to import the data and map the field and as per the given condition we have  write scripct

Run script:- 

target.user_name = 'corp/' + source.u_first_name.toLowerCase() + '.' +    source.u_last_name.toLowerCase();

    var name = source.u_first_name.toString();

                var fname = name.toLowerCase();

    var lname = source.u_last_name.toString();

               

    var fletter = fname.charAt(0);

    var letter = lname.charAt(lname.length-1);

    var pass = 'pwd@' + fletter + '$' + letter;

 

    target.user_password.setDisplayValue(pass);