How to populate first name and last name of the user in respective fields using reference function?

Ankit Pal
Tera Contributor

Hi,

I want to customize a user form in resource module in ServiceNow, where if I select the name of the person from User table (using reference field) then first name and last names should be picked and filled up in their respective fields. Currently what happening is, the complete name is getting filled in first name and last name field in the form.  

 

Thanks 

Ankit

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not show the first name and last name as dot walked fields instead of writing script etc?

it would be happening OOB.

When you change user it would auto-populate those dot walked fields

Regards
Ankur

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

View solution in original post

4 REPLIES 4

Aman Kumar S
Kilo Patron

What code are you using?

use the fields first_name and last_name.

 

Feel free to mark correct, If I answered your query.

Will be helpful for future visitors looking for similar questions 🙂

 

Best Regards
Aman Kumar

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

why not show the first name and last name as dot walked fields instead of writing script etc?

it would be happening OOB.

When you change user it would auto-populate those dot walked fields

Regards
Ankur

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

@Ankit Pal 

Hope you are doing good.

Did my reply answer your question?

If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Regards
Ankur

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

Hi Ankur,

 

Thanks for your reply, yes your solution was useful for populating the names and solved my issue. 

 

Kind regards

Ankit