List collect task scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 11:15 AM
New to scripting and flow designer
I coped the script and replaced it with my specific variable from this post : Solved: Generating tasks from a list collector in a Servic... - ServiceNow Community
I'm looking to select groups from the list of 'Build/Test/Implementation groups' and create a task for each selected group.
Keep getting this error, can someone please help
This is my script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2024 11:44 AM - edited 07-02-2024 11:53 AM
The function declaration is usually present when you create a new Catalog Client script, but if you paste/type something, then change the Type of script it can get omitted. You have pictured an onSubmit Catalog Client script, but the script was intended to be used in a workflow (server-side) Run Script activity. So just for FYI, the Catalog Client script needs these first and last lines:
function onSubmit() {
}
but you wouldn't use an onSubmit Catalog Client script that applies to tasks to create Catalog Tasks, and server syntax like 'current', 'current.variables', etc won't work on client scripts. These posts will get you closer to a solution if you are using Flow Designer in place of the Workflow Editor: