- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2025 01:55 AM
Hi Community,
I’m working on a ServiceNow catalog item and want to dynamically populate one variable based on the selection in another variable.
Scenario:
I have a variable “select_the_requested_group” with choices:
ABC
DEF
GHI
JKL
MNO
I have another variable “copy_of_select_the_requested_group” that should automatically populate with a corresponding backend value when a group is selected.
For example:
select_the_requested_group copy_of_select_the_requested_group
ABC XYZ
DEF PQR
GHI LMN
JKL STU
MNO VWX
I want this to happen automatically, without the user having to type anything.
How to Achieve This?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2025 02:17 AM
Hi @tilekarnilesh ,
I tried your problem in my PDI it is working fine for me please check below solution
Create 2 select box type fields
select_the_requested_group and copy_of_select_the_requested_group
In Configuration of these fields give the same backend name of choices like below
This is for select_the_requested_group
This is for copy_of_select_the_requested_group
Create a catalog client script which run onChange of select_the_requested_group and add below code
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
// If user changes the application value → set I Change = Yes
alert("Here");
g_form.setValue('copy_of_select_the_requested_group', newValue);
}
Note: Here if you have 50 of choices it will work fine with just one line of code, you just need to give same backend name of your choices.
Result
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2025 04:18 AM
Working fine Thanks..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2025 02:25 AM
what do you mean by backend value?
are you saying you want choice value to be auto-populated in 2nd variable?
If yes then what's the business requirement for this 2nd variable when user is already selecting the choice in 1st variable?
It's just a repetition of the info
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2025 03:12 AM
@Ankur Bawiskar User choice values and backend groups are different. The backend developer team has separate values that users may not understand. Linking these will make it easier for users to select correctly, while the backend team can continue working according to their group values..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2025 04:32 AM
the Answer you marked correct is doing what I mentioned
I still don't think it's a valid business requirement to simply get the choice value from 1st variable and populate in 2nd.
Could you give me the exact business use-case here?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
