Populating caller location using default value

Community Alums
Not applicable

Hi All,

I want to populate the incident caller's location on location field using the default value.
I tried with javascript:gs.getcaller_id().getRecord().getDisplayValue("location");  but it is not working.
Can you please help how can I achieve this ?

Note: Location field created on task table.

27 REPLIES 27

It should be, can you show how you are adding in form layout ? check view name is correct

find_real_file.png

Please hit like and mark my response as correct if that helps
Regards,
Musab

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you want to populate location for caller user or logged in user?

Are you populating caller with logged in user by default?

if yes then update this in your default value for location field

javascript: gs.getUser().getLocation();

Regards
Ankur

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

Community Alums
Not applicable

no, we are not populating caller with logged in user by default.

 

Check my update, you can do with dot walking of caller field

Please hit like and mark my response as correct if that helps
Regards,
Musab

Hi,

then how do you want to populate location for logged in user?

if yes then I already shared the approach

javascript: gs.getUser().getLocation();

If not then please discuss with your customer for correct requirement.

Regards
Ankur

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