- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2024 11:46 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 06:45 PM
@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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 05:37 AM
tried this but its not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2024 04:43 AM
You also need to change the reference table on the 'application_business_unit' variable to the 'business_unit' table instead of cmdb_ci_business_app.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 05:28 AM
@Community Alums
I didn't get the logic of both variables referring to same table
Since both are referring to same table and 1 table can have only 1 display value field, both the variables will show the same value
2nd variable should be of string type and then your script will work fine and make sense to show the name
At 1st place why to have 2 variables but?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2024 05:34 AM
in the first variable we are populating the application name where as in variable 2 we need to populate the business unit of the application name selected in variable 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2024 08:28 PM
@Community Alums
but both variable are referring to same table and both the variables will show same display value when selected or populated
How does it solve your purpose of showing business unit name of the app selected in variable 1
Please share some screenshots.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader