Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Auto populate Department and Location field

Kiff
Giga Expert

In creating a new hardware record, i want to auto populate ''Department'' and ''Location'' fields when ''assigned to'' is not empty. Basically, i need the Department and Location field to have the same information from the user profile in the  ''assigned to'' field.

Can anyone help with a script for this or is their a condition i can use to achieve this?

find_real_file.png

1 ACCEPTED SOLUTION

jacob_benker
Tera Expert

Kiff,

This should be OOTB functionality.

You should have a Client Script on the [alm_asset] table called "Set Loc/CC/Dep/Com from assigned to".

View solution in original post

9 REPLIES 9

shloke04
Kilo Patron

Hi,

 

How are you creating these records? Is it a manual creation or via some Transform or integration?

 

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi Shloke04,

 

It is manual creation

Ok. Then write a Script Include and a on Change Client Script on that table to set the values for both Location and Department. Please refer the below thread which gives a very good example on how to do this:)

 

https://community.servicenow.com/community?id=community_article&sys_id=9f7ce2e1dbd0dbc01dcaf3231f96196e

 

Hope this helps. Mark the answer as correct/helpful based on impact.

 

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

jacob_benker
Tera Expert

Kiff,

This should be OOTB functionality.

You should have a Client Script on the [alm_asset] table called "Set Loc/CC/Dep/Com from assigned to".