Select to view content in your preferred language

Failure to parse incoming JSON

1637
3
Jump to solution
04-25-2022 04:01 AM
kavi88
by
Occasional Contributor

Hello everyone,

I am trying to parse a json event in geoevent 10.7.1 using a field mapper, in order to flatten the structure and be able to access the indexed objects, yet i keep failling.

Here's how my field mpper looks like :

mapper.PNG

So, instead of getting the simple structure as defined in my target geoevent definition, i keep getting the initial structure.

 

Any ideas please ?

 

@RJSunderman EricIronside,

 

0 Kudos
2 Solutions

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi @kavi88,

I believe the issue is how you're specifying the array.  Try data.slots[0].id.

Here's what worked for me:

  1. Flattened the output GeoEvent Definition using the following script
  2. Created a Field Mapper as below:

JakeSkinner_0-1650892702730.png

 

View solution in original post

0 Kudos
JeffSilberberg
Frequent Contributor

 

Take your source data and run it through https://jsonlint.com/.  You will see that you have an array inside the data object but the data object is not an array.  

So data.slots[0].id looks like it might make more sense...  But I also have issues when working with arrays inside GeoEvent so let us know.. 

 

 


 

 

View solution in original post

0 Kudos
3 Replies
JakeSkinner
Esri Esteemed Contributor

Hi @kavi88,

I believe the issue is how you're specifying the array.  Try data.slots[0].id.

Here's what worked for me:

  1. Flattened the output GeoEvent Definition using the following script
  2. Created a Field Mapper as below:

JakeSkinner_0-1650892702730.png

 

0 Kudos
JeffSilberberg
Frequent Contributor

 

Take your source data and run it through https://jsonlint.com/.  You will see that you have an array inside the data object but the data object is not an array.  

So data.slots[0].id looks like it might make more sense...  But I also have issues when working with arrays inside GeoEvent so let us know.. 

 

 


 

 

0 Kudos
kavi88
by
Occasional Contributor

hello JeffSilberberg , JakeSkinner,

 

Thank you so much for your fast reply. it's now working as i want it !

0 Kudos