Single workflow for multiple Catalog Items

sanithakavungal
Giga Contributor

Hi All,

I have to create a Single Workflow for Multiple Catalog Items.Kindly help me on fetching the Catalog Item Name on the IF condition so that it will trigger the corresponding Task

Example : ABCD Workflow

A,B,C,D--Seperate Catalog Items

Single workflow   "ABCD Workflow" for all the A,B,C,D Catalog Items depends on the conditions.

If Catalog Items is A task should go the group W

If Catalog Items is B task should go the group X

If Catalog Items is C task should go the group Y

If Catalog Items is D task should go the group Z

I used the below script on IF condition,but it's not working.

answer = ifScript();

function ifScript() {

  if(current.cat_item.getDispalyValue() == 'A'){

  return 'yes';

  }

  else

  return 'no';

}

Kindly Suggest..!!

find_real_file.png

find_real_file.png

find_real_file.png

Regards,

Sanitha

1 ACCEPTED SOLUTION

Hi Sanitha,



I believe you are running the workflow at the RITM level.



So, here is how I would proceed.



Evaulate the combination and save it in the scratchpad variable as below.



runIt();



function runIt(){


var catItem = '';


if(current.cat_item.getDisplayValue() == 'A'){


catItem = 'A';


}


else if(current.cat_item.getDisplayValue() == 'B'){


catItem = 'B';


}


else if (current.cat_item.getDisplayValue() == 'C'){


catItem = 'C';


}


else{


catItem = 'D';


}



workflow.scratchpad.item = catItem;


}



Based on the value create a task either using activity or script.


View solution in original post

5 REPLIES 5

Glad that helped