how to use if/else statement in reference qualifier?

tejasweenipradh
Kilo Contributor

how to use if/else statement in reference qualifier?

4 REPLIES 4

AnirudhKumar
Mega Sage
Mega Sage

The  best way is to call a script include and move your if-else and rest of the logic there

javascript: new ScriptIncludeName().functioNameName()

Rekha Esadkar
Tera Expert

Hi Author,

It will not be best way to use if else in ref qualifier, you can use script include However, if you insist to use if-else Please refer below code.

javascript:if(current.variables.var1 == 'x')Group_member(current.variables.var2); else'active=true';

 

 

Sumanth16
Kilo Patron

Hi , 

 

Can you refer below link once:

https://community.servicenow.com/community?id=community_question&sys_id=e521e3c81b4d40d0a59033f2cd4bcb98

 

Please mark it as helpful (or) correct if it fix your issue.

 

Thanks,
Sumanth.

John Zhang1
Kilo Patron
Kilo Patron

I agree with all replies to put all business logic within script include, but we may need to pass the parameter (least 1) for callFunction of script includefind_real_file.png