- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 07:32 PM
I have 2 List Collector fields: Client Role 1 and Client Role 2. These 2 variables on the service portal have different options.
Question: Is it possible to map these 2 variables in 1 field only? Since they have different options, and needs to capture the selected value once submitted.
1:
2:
Solved! Go to Solution.
- Labels:
-
portal
-
Service Catalog
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 08:37 PM
Hey @ss123 :
We cannot map multiple catalog field values back to the same field using the map-to-field option
You can have BR or Flow Designer running on these requests getting submitted and in the script section concatenate the unique values
//split used for string to array conversion
var list1 = current.variables.u_client_role.toString().split(',');
var list2 = current.variables.client_role2.toString().split(',');
var au = new ArrayUtil();
var final_list = au.union (list1,list2); // return combination all elements in both list removing duplicates
current.<your list variable> = final_list.toString();
current.update();
Mark this as Helpful / Accept the Solution if this clears your issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 08:14 PM
Hi @ss123
no, it's not possible to map the two mentioned variables into 1 field and you have to find another approach, for example via a Flow. The challenge is to find the right joining strategy because list collector fields are comma-separated & unordered lists of Sys ID values. ServiceNow cannot know what you have in mind when saying "joining". For example, how do you want to handle duplicate Sys IDs?
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 08:37 PM
Hey @ss123 :
We cannot map multiple catalog field values back to the same field using the map-to-field option
You can have BR or Flow Designer running on these requests getting submitted and in the script section concatenate the unique values
//split used for string to array conversion
var list1 = current.variables.u_client_role.toString().split(',');
var list2 = current.variables.client_role2.toString().split(',');
var au = new ArrayUtil();
var final_list = au.union (list1,list2); // return combination all elements in both list removing duplicates
current.<your list variable> = final_list.toString();
current.update();
Mark this as Helpful / Accept the Solution if this clears your issue