- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 09:01 AM
hello,
I want to load multiple users on target table field 'Travelers list' which is 'List' field type. Travelers list takes users from reference table 'sys_user' search with user_name(id) column.
Currently created this field map and it is just updating one user. But when I load excel with multiple userid's seperated by comma all users must be saved in target table field.
please help me with the script.
Eg: A098765,A075431,A723090 (userid's) in excel of source table column
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2023 09:32 AM
Complete script to copy in script field:
answer = (function transformEntry(source) {
var users = [];
var grUser = new GlideRecord("sys_user");
grUser.addEncodedQuery("user_nameIN" + source.u_traveler_userid);
grUser.query();
while (grUser.next()) {
users.push(grUser.getValue("sys_id") + "");
}
return users.join(",");
})(source);
Thank you,
Ali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 10:30 PM
Hello @Mounika1001
The script should work irrespective of the number of users in the field. Please check once the length of your source (import set table) field length and also target field length.
Thank you,
Ali
Thank you,
Ali

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2023 10:30 PM
Hello @Mounika1001
The script should work irrespective of the number of users in the field. Please check once the length of your source (import set table) field length and also target field length.
Thank you,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2023 02:38 AM