- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 01:01 AM
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..!!
Regards,
Sanitha
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 01:30 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 01:08 AM
Hi Sanitha,
I believe you are trying to achieve (Check the combinations using 'if' activity), but this might not provide the exact result since the output will be either 'yes' or 'no'.
Similar to boolean 0 or 1.
You can use a runScript activity for the same and here you can specify the code actions based on the combination selected by the user. I would recommend you to use that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 01:21 AM
Hi Sudharsan,
Thanks for the reply..
Could you please explain with the script.
Regards,
Sanitha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 01:30 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2017 02:17 AM
Hi Sudharsanan,
Thanks..It worked..:)
Regards,
Sanitha