Workflow If statement using variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2019 11:34 AM
I have a workflow using an if statement that I would like to use a variable on a request item instead of just yes or no. I can select the variable when adding the if option but it does not seem to do anything. Do I need to modify the script to reference the variable?
I would like the if statement to trigger a different part of the workflow if certain locations are selected on the item variable as seen in the image below.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 08:24 AM
I think what he wants is to use a script. If they select the choices from the variable then the answer should be yes. How would the script look like?
Thanks
-Julio

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 03:03 PM
You can do
answer = ifscript();
function ifscript(){
if (current.variables.<variable_name1>=='value1' ||current.variables.<variable_name1>=='value2' || current.variables.<variable_name1>=='value3' )
{
return 'yes';
}
return 'no';
}
Please mark this response as correct or helpful if it assisted you with your question.