Create catalog tasks based on selections through list collector

NikhithaNikki
Tera Contributor

I have created list collector variable which is question choice record reference table and I need to create multiple catalog tasks based on the selections which was selected through list collector with flow designer can you please suggest me.

3 REPLIES 3

Roshnee Dash
Tera Guru

1. Capture Selections from List Collector

  • The List Collector stores multiple selected values.

  • Ensure that the variable is set to reference the correct table (e.g., question_choice).

2. Configure Flow Designer

  • Navigate to Flow Designer (Process Automation > Flow Designer).

  • Create a New Flow and set the trigger to "Requested Item Created".

3. Add an Action to Parse Selected Items

  • Use the "For Each" Loop to iterate through the selected choices.

  • Reference the List Collector variable inside the loop.

4. Create Catalog Tasks Dynamically

Inside the loop:

    • Add the "Create Task" action.

    • Set the Task Type to Catalog Task.

    • Dynamically populate Task Name, Description, and Assignment based on each selected item.

      •  
var selectedItems = flow.variables.list_collector_variable; // Replace with your variable name
for (var i = 0; i < selectedItems.length; i++) {
    var catalogTask = new GlideRecord('sc_task');
    catalogTask.initialize();
    catalogTask.short_description = 'Task for: ' + selectedItems[i];
    catalogTask.assignment_group = 'your_assignment_group'; // Set assignment dynamically
    catalogTask.request_item = flow.request_item.sys_id;
    catalogTask.insert();
}
  • (Above is the logic, but Flow Designer actions will be used instead of direct scripting)

 

5. Publish & Test

    • Ensure tasks are created correctly for each selection.

    • Validate task assignment and workflow behavior.

"Kindly mark this post as helpful or accept it as the solution if it resolved your issue."

Regards,
Roshnee

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

Hi @NikhithaNikki 
If you found my response helpful, please mark it as correct and close the thread so others can benefit from it too.

Your feedback makes the community stronger! If you found this helpful, marking it as the correct answer helps others.
Stay awesome,
Roshnee Dash

OlaN
Giga Sage
Giga Sage

Hi,

Hard to give a good answer, since you provided so little detail.

One way of doing it is to:

1. Get catalog variable (list collector)

2. Do a look up of records where sysID is one of the items in step 1

3. Do a for each loop for all records found in step 2

4. Create a catalog task for each iteration in the loop

 

This will mean sequential processing, no parallel execution of tasks.