AutoPopulate a reference field based on another reference both fields referring same table

Community Alums
Not applicable

Need to auto populate application business unit which is a reference field referring (cmdb_ci_business_app) depending on the business application field which is also a reference field also referring to (cmdb_ci_business_app) table on a catalog form.

Variable 1: Business Application (Reference - cmdb_ci_business_app)

variable 2: Application business unit(reference-cmdb_ci_business_app)

tried the autopopulate option on the variable it is populating on form level but on ritm its clearing the value.

written a script include and onchange client script also

able to get the value from script include but not able to set on the field . Its setting the value and clearing immediately 

please help

1 ACCEPTED SOLUTION

@Community Alums 

For this case you can use 2nd variable as string type and populate the Business unit via onChange client script

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

15 REPLIES 15

Your issue is that both variables should not be referring to the same table.  For the value that you are returning from the modified Script Include, your reference table on the 'application_business_unit' variable needs to be the 'business_unit' table instead of 'cmdb_ci_business_app'.