Work Flow Activity - Need to apply If Condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 07:26 AM
I have a catalogue item for Which number of task should be created depending on the variable drop down.
For one 2 task should be created
For another one, 4 tasks should be created..
Now i have designed work flow where all Four task are created but i need only 2 tasks to be created when one variable is selected.
Please reply
- Labels:
-
Best Practices

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 07:40 AM
Hello Karthik,
You can create the catalog task based on variable via run script activity. The sample code in the below blog. Adjust it accordingly.
Auto create Catalog Task based on Item Variables
Please let me know if you are blocked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 07:44 AM
Hi Karthrik,
You can add a Branch activity to your workflow, then add conditions to it (right click on it and choose Add condition).
Give the condition a name and then in the condition, type current.variables.<VARIABLE_NAME> == 'VARIABLE OF CHOOSEN VALUE'
connect the conditions to the task creation activities.
See a sample screenshot below, where ,my variables are domain and email
and here is what the condition looks like:
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2017 07:52 AM
Hi,
You can use Branch, Switch, if any of these activities:
Create an If activity and paste the below code:
answer = ifVariable();
function ifVariable() {
if (current.variables.<variable name>== <value> ) {
return 'yes';
}
return 'no';
}
From Yes link it to 4tasks you have created and from No link it to 2 tasks among those 4 tasks. other 2 tasks will automatically be skipped.
Regards,
Souren