How can I get variables from service catalog and pass them in a POST message?

fwgfs
Kilo Contributor

I am new with servicenow and I'm trying to do what I describe below.

I have this service catalog:

find_real_file.png

And I have an outbound rest message that sends the following parameters in the content:

 
{
  "templateParameters": {
    "environment": "test",
    "team": "test",
    "vm_type": "linux" ,
    "vm_number": "1",
    "vm_size": "large",
    "data_diks_additional": "No",
    "vm_password": "test",
    "data_diks_adittional_number": "0",
  }
}

But what I need to do - and I have no idea how to do it - is to get the variables from the service catalog and put them in the content of the parameters. I think I can do it in the workflow; I read in the documentation that I can do something like

In the request:

"environment": ${environment}

In the workflow script:

var environment = current.variables.environment;

Any suggestion about how to do it?