x
login Signup

Get list of formal parameter names using javascript

Submitting to here question received on help center.

I am trying to create inside a job step a string that contains a space separated names of formal parameters of a procedure, using javascript. How do I do this?

What about getting a list of custom parameters of the job?

avatar image By gzeng 172 asked Jan 22, 2016 at 05:45 PM
more ▼
(comments are locked)
10|750 characters needed characters left

1 answer: sort voted first

You can get a space-separated list of formal parameter names for the current procedure with this:

 $[/javascript
 var all = '';
 for (var key in (myProcedure.formalParameter))
 {
   all += ' ' + myProcedure.formalParameter[key].name;
 }
 all;
 ]

Note that myProcedure relative path will refer to the innermost nested procedure if the current step is part of a subprocedure.

If you want the job level actual parameter names you can use

for (var param in (myJob.actualParameters)) { all += ' ' + param; }

but this will include some intrinsic properties as well. I'm not sure if there's a better way to get just the custom parameters.

avatar image By gzeng 172 answered Jan 22, 2016 at 05:58 PM
more ▼
(comments are locked)
10|750 characters needed characters left
Your answer
toggle preview:

Up to 8 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.