Create Different Task Titles from One Catalog Item

delawareang31
Tera Contributor

Is there a way to create different Catalog Task Titles based on the variables that are selected when the user is filling out the Catalog Form?  For example, if there was a Time Off Catalog Form with options for 'PTO' and 'Unpaid Time Off' could I have the Task Title of the Catalog Task that is created to dynamically be 'PTO Request' or 'Unpaid Time Off Request' depending on the option selected?

1 ACCEPTED SOLUTION

Hi @delawareang31 that is possibe, if your using workflow before task creation, have a if activity to check variable name whether it is 'PTO' and 'Unpaid Time Off'  and if yes is PTO then connect to catalog task if No connect to another catalog task.

If your using flow designer, you can create a flow variable which will store the variable value and while creating catalog task you can set short description to this flow variable which will be dynamic

Regards
Harish

View solution in original post

8 REPLIES 8

Hi @delawareang31 that is possibe, if your using workflow before task creation, have a if activity to check variable name whether it is 'PTO' and 'Unpaid Time Off'  and if yes is PTO then connect to catalog task if No connect to another catalog task.

If your using flow designer, you can create a flow variable which will store the variable value and while creating catalog task you can set short description to this flow variable which will be dynamic

Regards
Harish

@Harish KM I'm using a workflow, and I've tried onLoad and onSubmit as the command, without success.  I appreciate your suggestion, and I feel like what you recommended should be working.  Thank you!

Hi @delawareang31 if your using workflow, another way is to use a run script before catalog task creation,

in your run script have a workflow scratchpad variable to capture variable value

script:

if(current.variables.variablename =="PTO"){

workflow.scractchpad.shortDescription = "PTO Request";

}

else

{

workflow.scractchpad.shortDescription = Unpaid Time Off Request";

}

use the above scratchpad while creating a task.

var task = new GlideRecord("sc_task");

task.initialize();

task.short_description = workflow.scractchpad.shortDescription; // this will be dynamic

task.insert();

Regards
Harish

@Harish KM I was able to use a Script on the workflow to set task.[task_field_name] = current.variables.[catalog_task_variable_name] after dynamically setting the [catalog_task_variable_name] with Catalog UI Policies in the Catalog Form.  Thank you for the help!