Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

guided setup

garimakharb
Giga Guru

I am creating a Guided setup .. and I got to know that it is itself a playbook.
So, Can someone know? that How to call a script action in playbook?

 

1 REPLY 1

MaxMixali
Tera Guru

Using the "Run Script" Action

  1. In your Playbook, add an action step
  2. Search for and select "Run Script" action
  3. In the script field, write your JavaScript code
  4. You can access playbook context variables using the inputs object
 
 
javascript ssample code:
(function execute(inputs, outputs) {
    // Your script logic here
    var result = inputs.input_variable;
    
    // Process your logic
    gs.info('Processing: ' + result);
    
    // Set outputs if needed
    outputs.output_variable = 'some value';
    
})(inputs, outputs);