In FLOW DESIGNER which data type can be used to store nested json

shivanki1
Mega Expert

Hi All,

Please help me with below query !

 

We are using integration hub for Rest API outbound integration call to create catalog tasks in another instance.

Which input / output variable in flow designer can be used to store array of JSON ?

I was looking into few data types such as Name-value pairs and not sure id i can use it and how to access and set them ?

- The goal is to send the RITM variables in below format in payload

{ "variables":[

{"question":"quest1","value":"value1"},

{"question":"quest2","value":"value2"},

{"question":"quest3","value":"value3"}, ]",

"number":"SCTASK000XXXXXXX",

"short_description":"test"

}

1 ACCEPTED SOLUTION

shivanki1
Mega Expert

I used normal String type to store the above  and passed to Payload builder.

It worked perfectly fine in outbound

View solution in original post

4 REPLIES 4

sachin_namjoshi
Kilo Patron
Kilo Patron

You should use Payload Builder step in flow designer to build this kind of payload

 

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/flow-designer/referen...

 

 

Regards,

Sachin

Hi Sachin,

 

Thank you for reply ! I am using payload builder already but I cannot fetch variables in the builder step therefore i have created a script step to fetch variables.

The output i am setting to payload builder 'Variables' field. But since in the script my output variable is string the double codes are being converted to escape character.

Can the output variable be any other data type that supports my format.

 

Arsh2
Tera Guru

Hi Shivanki,

 

you have to use child objects in output variable to create JSON type array in the output.

 

Please refer to the below document for reference.

 

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/flow-designer/task/cr...

 

Hope it helps. 

 

Cheers,
Arsh

shivanki1
Mega Expert

I used normal String type to store the above  and passed to Payload builder.

It worked perfectly fine in outbound