How to get value of variable inside a MRVS to be used in a workflow

JR Oliver
Tera Contributor

Hi I have a requirement where in the Variable Set named Server build //server_build - internal name. 

It has a variable "is_this_for_a_new_application" where it is a Yes/No type.

 

I need to get the value in the If Script for "is_this_for_a_new_application" variable.

If is_this_for_a_new_application is Yes it should return Yes

and If  is_this_for_a_new_application is No it should return No.

2 REPLIES 2

Amitoj Wadhera
Kilo Sage

Hi @JR Oliver ,

 

You can simply write:

if(current.variables.is_this_for_a_new_application.toString() === 'Yes')
          return true;
return false;

 

If you find my response helpful, please consider marking it as the 'Accepted Solution' and giving it a 'Helpful' rating. Your feedback not only supports the community but also encourages me to continue providing valuable assistance.

 

Thanks,

Amitoj Wadhera

Hi Amitoj,

 

It did'nt work for me see below script:

The script is inside a "If" Workflow activity that is why I changed the return to 'yes' or 'no'.

 

answer = ifScript();
function ifScript(){
if(current.variables.sb_is_this_for_a_new_application.toString() === 'Yes'){
return 'yes';
}
return 'no';