I tried to find Yes No condition
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 06:57 AM
I used If condition and tried to find the yes no value with given below script but only getting no condition in workflow.
// This script needs to set answer to 'yes' or 'no' to indicate the state of the activity.
answer = ifScript();
function ifScript() {
var gr = new GlideRecord("sc_req_item");
gr.addQuery('request_item', current.sys_id);
gr.query();
var blockedcontry;
if (gr.next() ) {
var listedcountry = gr.variables.do_you_intend_on_logging_in_or_working_from_the_listed_country_ies;
//var blockedcontry;
var gr1 = new GlideRecord('core_country');
gr1.addQuery('sys_id', gr.variables.select_which_country_ies_you_will_be_visiting);
gr1.query();
if (gr1.next() ) {
blockedcontry = gr1.u_blocked_country;
}
if(blockedcontry == 'false' && listedcountry == 'Yes') {
return 'yes';
}
if(blockedcontry == 'true' && glistedcountrys == 'Yes') {
return 'no';
}
}
}
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 07:09 AM
Hi @Ajay Singh2
the "true" / "false" values are internally stored as "1" or "0" so try it with these values.
Maik