How add the JSON data in the fields?

sri83
Tera Guru

Hi Team,

 

As shown below, we receive JSON data from a third party system, and we need to store this data in a custom table.

I have created the import set table and mapping with target table. could you please suggest how to process the Applications [] array related data into the target table fields?

Thanks In advance

 

JSON Fomat:

 

{
"u_sys_id": "5f82c76f1b50e1106c1ab9118b4bcb55",
"u_state": "Ready",
"u_comments": "Sample comments",
"u_priority": "High",
"u_correlation_id": "TICKET123456789",
"applications": [
{
"name 1": "value 1",
"name 2": "value 2",
"name 3": "value 3",
"name 4": "value 4",
"name 5": "value 5"
}
]
}

1 ACCEPTED SOLUTION

sri83
Tera Guru

I have done achieved the requirement through Scripted REST Api. Thanks All!

View solution in original post

8 REPLIES 8

Hi Ankur,

Thanks for the quick reply.

we are receiving the data as mentioned below format in payload.to process the below requirement i am following inbound integration.
can you please give me some information to achive the below requirement through scripted rest API.

 

{
"u_sys_id": "5f82c76f1b50e1106c1ab9118b4bcb55",
"u_state": "Ready",
"u_comments": "Sample comments",
"u_priority": "High",
"u_correlation_id": "TICKET123456789",
"applications": [
{
"name 1": "value 1",
"name 2": "value 2",
"name 3": "value 3",
"name 4": "value 4",
"name 5": "value 5"
}
],

"process": [
{
"name 1": "value 1",
"name 2": "value 2",
"name 3": "value 3",
"name 4": "value 4",
"name 5": "value 5"
}
]
}

 

 

@sri83 

you can parse the incoming json and iterate the applications array

I believe name1 means column name and value 1 means value for that column

what script did you start with?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

 

 

 

 

sri83
Tera Guru

I have done achieved the requirement through Scripted REST Api. Thanks All!