Please explain current.variable_pool

Mrman
Tera Guru

Hi ,

Can someone please let me know what is "current.variable_pool" used in the business rule to call the Rest message . We are calling the REST messages for posting the varaibles information to 3rd party tool.

Our script looks like this , please clarify   what is difference between r.setStringParameter('your rest parameter name using which you want to send', current.variables.your_variable_name); and the below mentioned.

var r = new sn_ws.RESTMessageV2('Tufin New VPN Request', 'post');

  r.setEccParameter('skip_sensor', true);  

  r.setStringParameter('algorithm', current.variable_pool.algorithm.getDisplayValue());

  r.setStringParameter('bpemail1', current.variable_pool.partnerEmail1);

  r.setStringParameter('bpemail2', current.variable_pool.partnerEmail2);

  r.setStringParameter('bpname', current.variable_pool.partnerName1);

  r.setStringParameter('bpname2', current.variable_pool.partnerName2);

  r.setStringParameter('bpphn1', current.variable_pool.bpphn1);

  r.setStringParameter('bpphn2', current.variable_pool.bpphn2);

  r.setStringParameter('citrix', current.variable_pool.citrix.getDisplayValue());

  r.setStringParameter('company', current.variable_pool.companyName.getDisplayValue());

1 ACCEPTED SOLUTION

Yes you can use the current.variables.variable_name syntax instead of the variable_pool, both should work.



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


View solution in original post

11 REPLIES 11

Alikutty A
Tera Sage

Hi Ravi,



You are accessing the value of variables in a requested item using the variable_pool. You can also use the variables object to access this value from a RITM.



current.variable_pool.partnerEmail1 is also same as current.variables.partnerEmail1



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


Here are few other information



variable_pool and variables refer to the same object but the former is an older version used in Service Now to access variable values.   It's similar to variables where it's an object that let's you access variable values from the requested item in a script.



current.variable_pool.variableName;




Question: Whats is the difference between current.variables and current.variable_pool when it comes ...


what is the difference between variables and variable_pool used in catalog scripts?



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response


Hi Alikutty,



Thanks, So , I can use r.setStringParameter('your rest parameter name using which you want to send', current.variables.your_variable_name); instead of variable_pool ?



Will it give same result of sending the varaible information via REST API right?


Yes you can use the current.variables.variable_name syntax instead of the variable_pool, both should work.



Thank You


Please Hit Like, Helpful or Correct depending on the impact of response