- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 02:50 AM
Hi All,
I was comparing 2 reference fields in workflow script as below.
If new_owner is not the same as the one who is requested the item. Then, new owner should receive an approval request. If not , then it has to auto approve.
This script is written in IF condition block:
var newowner = current.variables.new_owner;
var reqfor = current.variables.requested_for;
answer = ifScript();
function ifScript() {
if (newowner != reqfor) {
return 'yes';
}
return 'no';
}
Even though newowner is not same as reqfor, it is going to Yes part. But it has to go to No.
Please help me in resolving this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 03:52 AM
you should not use apostrophe(' ')
use this : answer.push(current.variables.new_owner)
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2024 03:52 AM
you should not use apostrophe(' ')
use this : answer.push(current.variables.new_owner)
Regards,
Piyush Sain