I tried to find Yes No condition

Ajay Singh2
Tera Contributor

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

Maik Skoddow
Tera Patron
Tera Patron

Hi @Ajay Singh2 

the "true" / "false" values are internally stored as "1" or "0" so try it with these values.

Maik