IF Condition in workflow always returns yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 04:21 AM
I am try to write a IF condition advanced script that will be yes if some locations but no if it is the rest. This will allow me to assign it to the correct assignment group in the workflow. The location variable is a reference field so im not sure if that my issue or not. Please tell me why my script keeps returning yes every time. See script below.
function ifScript() {
if (current.variables.cmn_location != 'Olofstrom' || current.variables.cmn_location != 'Bielsko-Biala' || current.variables.cmn_location != 'Gothenburg' || current.variables.cmn_location != 'Forsheda')
return 'yes';
else
return 'no';

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 06:00 AM
Have you tried to put the logs and see what current.variables.location is returning?
Thanks,
Sunil Safare

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 06:02 AM
Hi Chris,
Can you try with one if condition and check the behavior once.
if(current.variables.location.getDisplayValue() != 'Olofstrom')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 06:29 AM
do you want me to include the returns?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 09:46 AM
I tried the one If statement and it work the opposite way I wanted to but that's ok I can switch the tasks, how can I add multiple locations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2015 10:11 AM
actual individual If condition does not work