And condition not working in flow designer

SHALIKAS
Tera Guru

I have written the script for approval as follows

var ass = fd_data.trigger.request_item.assignment_group;
if(fd_data._1__get_catalog_variables.will_the_server_be_supported_by_sso_or_the_project_team == 'Project' && fd_data._1__get_catalog_variables.server_support_group=='ef645b011b75e5505c1f99ba234bcbe8')
{
    return "ApprovesRejectsAnyG[392a0a76ebac6e1014e3f7e2dad0cdb1]";
}
else{
 
    return "ApprovesRejectsAnyG[" + ass + "]";
}
Every time the approval is going to else condition even though the 1st condition is passing
Is there that I am writing incorrect 'AND' condition in if statement
2 ACCEPTED SOLUTIONS

Ankur Bawiskar
Tera Patron
Tera Patron

@SHALIKAS 

are you sure you are comparing the correct variable value for "will_the_server_be_supported_by_sso_or_the_project_team"

Should it be Project or project ?

what's the variable type for "will_the_server_be_supported_by_sso_or_the_project_team"?

print the value and see and then compare properly

var ass = fd_data.trigger.request_item.assignment_group;
gs.info('project team' + fd_data._1__get_catalog_variables.will_the_server_be_supported_by_sso_or_the_project_team);
gs.info('support group' + fd_data._1__get_catalog_variables.server_support_group);
if(fd_data._1__get_catalog_variables.will_the_server_be_supported_by_sso_or_the_project_team == 'Project' && fd_data._1__get_catalog_variables.server_support_group=='ef645b011b75e5505c1f99ba234bcbe8')
{
    return "ApprovesRejectsAnyG[392a0a76ebac6e1014e3f7e2dad0cdb1]";
}
else{
 
    return "ApprovesRejectsAnyG[" + ass + "]";
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

Shivalika
Mega Sage

Hello @SHALIKAS 

 

Can you print those catalog variables value which you are fetching and see ? 

 

Also print the value of condition check and see if everything is working as expected. I am sure it's breaking there somewhere. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

View solution in original post

2 REPLIES 2

Ankur Bawiskar
Tera Patron
Tera Patron

@SHALIKAS 

are you sure you are comparing the correct variable value for "will_the_server_be_supported_by_sso_or_the_project_team"

Should it be Project or project ?

what's the variable type for "will_the_server_be_supported_by_sso_or_the_project_team"?

print the value and see and then compare properly

var ass = fd_data.trigger.request_item.assignment_group;
gs.info('project team' + fd_data._1__get_catalog_variables.will_the_server_be_supported_by_sso_or_the_project_team);
gs.info('support group' + fd_data._1__get_catalog_variables.server_support_group);
if(fd_data._1__get_catalog_variables.will_the_server_be_supported_by_sso_or_the_project_team == 'Project' && fd_data._1__get_catalog_variables.server_support_group=='ef645b011b75e5505c1f99ba234bcbe8')
{
    return "ApprovesRejectsAnyG[392a0a76ebac6e1014e3f7e2dad0cdb1]";
}
else{
 
    return "ApprovesRejectsAnyG[" + ass + "]";
}

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Shivalika
Mega Sage

Hello @SHALIKAS 

 

Can you print those catalog variables value which you are fetching and see ? 

 

Also print the value of condition check and see if everything is working as expected. I am sure it's breaking there somewhere. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY