The CreatorCon Call for Content is officially open! Get started here.

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

Thanks Alikutty.



I need some help on Sending the Catalog task information to 3rd party tool vika REST API .Could you please let me know if you can help so I can contact you .


You can post your queries here and I can help you.



If your initial query is answered, can you please mark my first response as correct answer so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.



If you are viewing this from the community inbox you will not see the correct answer button.   If so, please review https://community.servicenow.com/docs/DOC-5601



Thank You


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


Ok Alikutty I will mark it .


Please clarify my requirement.please see details below .


>> Second task should only be sent for the 'New Extranet Firewall Request', "International FW Request" and 'New MetLife VPN Request'


>> Second task should be sent to Tufin under 'Task for Implementation Team'



If you see the below workflow , there are two catalog Tasks highlighted . Please guide me how to send the second task for above types only.


find_real_file.png


Please see below script , it is doing teh glide record for sc_task and sending in REST MESSAGE.


tsk = new GlideRecord('sc_task');


  tsk.addQuery('request_item', current.sys_id);


  tsk.addQuery('active', true);


  tsk.query();


  while(tsk.next()){


  r.setStringParameter('task', tsk.number);


  tref = tsk.sys_id;


  task = thref+tref;


  r.setStringParameter('itemId', tsk.sys_id);


  r.setStringParameter('tasklink', task);



find_real_file.png


Hi AliKutty,



Also we are using MID Server.


Can you paste the complete script you have for Rest call? Also is this is an existing functionality?



Thank You


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