Hi All,


I have a question on JSON deserializtion,

I have following data which i need to deserialize and add it to my server entities.

[
   {
      "Contact":{
         "Id":116,
         "Name":"abc",
      }
   },

{
      "Contact":{
         "Id":69,
         "Name":"xyz"
      }
   },

]


I am using above data as value for  JSON String parameter for JSONDeserialize componet.

i.e. JSON String : "[{""Contact"":{""Id"":116,""Name"":""Abel Pasquale""}},{""Contact"":{""Id"":146,""Name"":""Adam Dimaggio""}}]"

When i try to deseralize data, it gives me following error

Please can anyone help me on this.



Thanks.



Hi, could you perhaps try this JSON:

[
   {
      "Contact":{
         "Id":116,
         "Name":"abc"
      }
   },

{
      "Contact":{
         "Id":69,
         "Name":"xyz"
      }
   }

]

If that doesn't work, please post your structure in the Data tab

Dylan Heunis wrote:

Hi, could you perhaps try this JSON:

[
   {
      "Contact":{
         "Id":116,
         "Name":"abc"
      }
   },

{
      "Contact":{
         "Id":69,
         "Name":"xyz"
      }
   }

]

If that doesn't work, please post your structure in the Data tab

Hi Dylan,


It gives me error,

Please find it in attachment.

JSON is not correct gives me following error

Syntax error caused by unexpected '[' element in expression.


Hi,


Please supply us with the structure of the ContactEntityRecord

Dhiraj Manwani wrote:

Hi All,


I have a question on JSON deserializtion,

I have following data which i need to deserialize and add it to my server entities.

[
   {
      "Contact":{
         "Id":116,
         "Name":"abc",
      }
   },

{
      "Contact":{
         "Id":69,
         "Name":"xyz"
      }
   },

]


I am using above data as value for  JSON String parameter for JSONDeserialize componet.

i.e. JSON String : "[{""Contact"":{""Id"":116,""Name"":""Abel Pasquale""}},{""Contact"":{""Id"":146,""Name"":""Adam Dimaggio""}}]"

When i try to deseralize data, it gives me following error

Please can anyone help me on this.



Thanks.




Hi Dhiraj,

You can use OnAfterResponse action to edit the Json returned by service to fit the existing structure.

Check here. This may help you.

Regards,

Seema

Dylan Heunis wrote:

Hi,


Please supply us with the structure of the ContactEntityRecord


Hi Dylan,


Thanks for the concern, i solved the issue.

The structure was correct.

The thing i was doing wrong was, i had to use array of object i.e. List or Record,

since it was a JSON object.

so i solved it by using ContactList.

:)

Dhiraj M.