Need to convert catalog variables into JSON and store it as a variable to use it in workflow

redth
Giga Expert

Hi,

I need to convert catalog variables (application, application process, environment, versions and components) selected by the user into JSON format so that I can use it for deployment in the workflow.

Below is the format:

{
  "application": "hello Application",
  "applicationProcess": "hello App Process",
  "environment": "helloDeploy",
  "versions": [{
    "version": "1.0",
    "component": "helloWorld"
  }]
}
Can you assist me in implementing this requirement?
1 ACCEPTED SOLUTION

SanjivMeher
Kilo Patron
Kilo Patron

Do this

 

var test = { "application": current.variables.var1 , "applicationProcess":current.variables.var2, "environment":current.variables.var3, "versions": [{ "version": "1.0", "component": "helloWorld" }] }


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

5 REPLIES 5

It depends on the end point how they formatted and sending the data. So you don't have a control on that. You will have to parse it at servicenow on whatever format they send


Please mark this response as correct or helpful if it assisted you with your question.