- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 05:35 AM
Hello developers,
i want catalog task to get assigned to various groups based on configurations on UI. i have stored the assignment group in a scratchpad variable, when im trying to assign it to catalog task
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 08:44 AM
Hi @servicenow14710,
Hmmm, interesting, but this may also point to the issue in that you're actually retrieving an object. Obviously, without first-hand sight, these are just thoughts out loud.
See and try the below slight tweak.
var spAmsGroupValue = workflow.scratchpad.amsGroup.toString(); //converting to a String object
var tskAmsGroup = spAmsGroupValue.trim(); //removing any white space
task.assignment_group = tskAmsGroup;
To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 06:03 AM
are you sure there are no leading and trailing spaces in that scratchpad variable?
print the value and then try to use trim() method to see if that works
I agree with @Robbie here
gs.info('group is' + workflow.scratchpad.amsGroup);
task.assignment_group =workflow.scratchpad.amsGroup.trim();
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
02-03-2025 07:13 AM
Thanks for the validation @Ankur Bawiskar.
Feel free to mark my response helpful in order to help others and for me to gain recognition of my efforts.
Thanks, Robbie
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 07:05 AM
> i have stored the assignment group in a scratchpad
Can you show the code how you do that?