Auto Generate Child Tasks on Custom App

Cori4
Kilo Explorer

First, I must start this post by saying I am new to the development side of things in ServiceNow so please bear with me.  I have built a custom app for one of our departments that I need to be able to generate multiple tasks for a record from the items chosen in a list collector field on a Record Producer.  This department translates equipment documentation into other languages.  When someone request to have a document translated, it could be from 1 language up to 21 different languages.  I need to be able to auto generate a separate task for each language selected in the list collector field in my record producer.  I am not sure if this should be done through Flow Designer or a script (which I am horrible at) or business rules.  I just don’t know how to get there.

Here is what I have so far:

I have created the master table (Localization) that extends the Task table.  This table is the list of project records.

I have created the child task table (L10N Tasks) that also extends the Task table.  This table will be where the individual language tasks will be stored for the records in the Localization table.

I have created the Related Lists record to get the L10N Tasks list to show on the bottom of the Localization record form.  This does at least get me the ability for them to manually add language tasks but that would leave the task creation up to the group managing the records.  We would like this to auto create the tasks when the customer requesting the translations uses the Record Producer in the catalog to request the project.

find_real_file.png

On the Record Producer (Request a Project or Quote) I have a List Collector field that references a table (Languages) so that the requester can pick the languages (not all are listed below) they would like to convert the document to.

find_real_file.png

Is it possible for a child task (L10NTASK on the L10N Task Table) to be created when the Record Producer creates a new record (L10N from the Localization Table) and have it show in the Task list at the bottom of the new record?  One L10NTASK for each language selected?  This would be a fluctuating number of tasks per record.

I am not sure of the best way for the L10NTASKs to get generated or how to make sure they add into the Task list on the parent L10N record.  Any help or point in the right direction would be greatly appreciated.

9 REPLIES 9

ccajohnson
Kilo Sage

A few clarifying questions so that we can narrow our solution accordingly.

Is the List Collector pushing its values to a List field on your custom parent table?
Will users be creating parent records manually, or is everything driven from the Record Producer?

I would lean more towards creating a workflow on your parent table so that it will run when the record is submitted. Here is a general outline of the workflow itself:

Create a Split at the beginning of the workflow so that you can have multiple tasks spawned based upon what was selected in the List.

Since List Collector variables and List fields are really an array of sys_id values, you would create an If workflow activity before each task that determines if a selection is made. This will need to be scripted in some way, and I would recommend using a Script Include so that you can leverage a single function to avoid possible mistakes.

You would then create a separate Task workflow activity that creates the tasks. It is unclear what field you are using on the L10N Task table to relate it to its parent, but you would have to make sure that whatever field you are using is populated with the current.sys_id of the L10N table.

Then you add a Join workflow activity that joins all of the tasks together. This will allow the workflow to actually wait until all of the spawned tasks are complete before you move on in the workflow.

Let us know if you need any clarifications so we can guide you accordingly. 

Thank you for the response.  To answer your questions:

  • The List Collector on the Record Producer does map to the Language field on the parent table.
  • All records will be created through the Record Producer.  I have removed the New button from the table to force this.
  • On the L10N Task table, I have a field called L10N Parent Record that I would like to use for the parent ticket number.

Since I haven't worked much with flow and workflow yet, do you think using workflow instead of the Flow Designer would be better?  Is there more flexibility with the workflows than with Flow Designer?  Again, I'm new to this part of ServiceNow so I'm curious about the difference between them.

Thanks again!

Since it appears to be a straightforward flow, you should be able to create a flow using Flow Designer. Here is a link to the documentation so you can get started: Flow Designer

I would think that you should be able to create a task based upon each of the List selections. For each Create Task action, you can set the appropriate fields to connect the task to the parent record.

If you are successful, let us know what you built so others can benefit from your work.

Cori4
Kilo Explorer

I'm still struggling with this one.  I have setup the flow in flow designer and it will create the tasks but it does not automatically associate them with the parent record.  They add to the task table but I can't get them to automatically tie to the parent.  Any thoughts on how to make them associate using the Flow Designer?  I can get them to associate if I click the New button from the parent record but I need to be able to have them create and associate with the creation of the parent record using the record producer.  Here is my flow:

find_real_file.png

find_real_file.png

find_real_file.png