The CreatorCon Call for Content is officially open! Get started here.

How to add Affected Cls in a catalog task using flow designer in servicenow

FaizDev101
Tera Expert
 
1 REPLY 1

Paul Deonarine3
Tera Expert

To add the Affected CI field to a catalog task using Flow Designer in ServiceNow, you can follow these steps:

  1. Open Flow Designer and create a new flow.
  2. Drag and drop the "Service Catalog Task" trigger onto the canvas.
  3. Configure the "Service Catalog Task" trigger to start the flow when a catalog task is created or updated.
  4. Drag and drop the "Transform" action onto the canvas, and connect it to the "Service Catalog Task" trigger.
  5. In the "Transform" action, select the "Affected CI" field from the catalog task data as the input.
  6. Use a script transform to map the input value to the desired output value. For example, you could use a script transform similar to the following to set the Affected CI field to a specific CI:

 

(function transformEntry(current, actions, state) {
  current.setValue('cmdb_ci', 'CI0000001');
})(data.current, data.actions, data.state);

 

This script sets the cmdb_ci field to CI0000001. Replace this value with the sys_id of the CI that you want to set.

  1. Drag and drop the "Update Record" action onto the canvas, and connect it to the "Transform" action.
  2. In the "Update Record" action, set the table to "Service Catalog Task", and use the "Current record" option for the record to update.
  3. Map the output of the "Transform" action to the "Affected CI" field in the "Update Record" action.

Now, when a catalog task is created or updated, the flow will automatically set the Affected CI field to the desired value.