How to get only one return in workflow if activity ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 12:09 AM
Hi All,
The below ifScript is not working, can anyone please help me on this ?
var usrDivision = current.variables.requested_for.company.sys_id;
var div = gs.getProperty('all.divisions');
var isUsrCI = div.includes(usrDivision);
var ans;
answer = ifScript();
function ifScript() {
var ans = 'yes';
if (isUsrCI == true) {
ans = 'yes';
}
return ans;
}
Can anyone please help me on the above.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 02:39 AM
I would recommend putting the entire code in the function, following the standard/suggested format for the function and return, and adding a temporary logging line like this to confirm the variable values:
answer = ifScript();
function ifScript() {
var usrDivision = current.variables.requested_for.company;
var div = gs.getProperty('all.divisions');
var isUsrCI = div.includes(usrDivision);
workflow.info('usrDivision= ' + usrDivision + ' div= ' + div + ' isUsrCI= ' + isUsrCI);
if (isUsrCI == true) {
return 'yes';
}
return 'no';
}