How can I auto populate user location information in service catalog variable?

itspezi1
Tera Guru

Hello team,
How can the location be automatically displayed by the user in the catalog item? What type do I have to add?

Many thanks

 

1 ACCEPTED SOLUTION

Allen Andreas
Administrator
Administrator

Hi,

So you'd create a reference variable that points to the location table, then you can set the default value of that variable to be:

find_real_file.png

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

Which will automatically place the location of that user in that field for you.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

10 REPLIES 10

Allen Andreas
Administrator
Administrator

Hi,

So you'd create a reference variable that points to the location table, then you can set the default value of that variable to be:

find_real_file.png

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

Which will automatically place the location of that user in that field for you.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

I would like to test it, but where is the address entered? can you help me?

Hi,

Above code will populate the location from user table, If that user have location entered.

To check location field have value or not.

Navigate to sys_user.list and open particular record and check location field.

Thanks,

Dhananjay.

Hi,

Please add the location field to your form so that you can populate it with an appropriate value.

From that screenshot, you can use the context menu or right-click the gray header area and choose "configure > layout" and then select the location field from the left and move it to the right and add it to your form. Save, then return to this form again and pick the location.

find_real_file.png

find_real_file.png

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!