How to autopopulate the country value from user record? ( not the location)

deepum
Giga Guru

How to auto populate the country value from the user record.??

i have created a catalog variable and used reference type. (Table : Core_country)

Should i give any default value in the variable using Java script or write onLoad catalog client script . Tried both yet the value will be empty or undefined.

Thanks in advance

1 ACCEPTED SOLUTION

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

try the solution proposed in the below threas, it should fit your need:

https://community.servicenow.com/community?id=community_question&sys_id=829a832ddb5cdbc01dcaf3231f96...

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

View solution in original post

3 REPLIES 3

Alberto Consonn
ServiceNow Employee
ServiceNow Employee

Hi,

try the solution proposed in the below threas, it should fit your need:

https://community.servicenow.com/community?id=community_question&sys_id=829a832ddb5cdbc01dcaf3231f96...

If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

Thank you

Cheers
Alberto

Hello Alberto,

 

Thank you for response. It worked out well.

 

But  I have a condition where the "requested by" and "requested for" will be different, Then how will be the case of getting the "requested for" country details using this scenario.

 

Thank you in advance

sachin_namjoshi
Kilo Patron
Kilo Patron

IF you need logged in users' country, then you can use below as default value in country reference field

 

gs.getUser().getCompanyID();

 

if You need country value based on user variable, then you need to configure on load client script, Glideajax to populate users' country based on user record.

 

Regards,

Sachin