1. Rodrigo Rosa
  2. PowerBuilder
  3. Monday, 6 January 2020 22:09 PM UTC

Hi,

How can I import a multiline Json with an array into a datawindow?

[
{
"id":123,
"agendamentoTED":false,
"usuario":"AUTOM",
"id_ususario":20141,
"idCanal":11,
"codigoBancoDestino":1,
"tipoConta":1,
"codigoFinalidade":2,
"array":[
{
"nm_user":"RO",
"age":15
}
],
"dataHoraAgendamento":"2019-12-20T11:17:21.95-03:00"
},
{
"id":456,
"agendamentoTED":false,
"id_ususario":"AUTOM",
"idCanal":11,
"codigoBancoDestino":1,
"tipoConta":1,
"codigoFinalidade":2,
"array":[
{
"nm_user":"NE",
"age":20
}
],
"dataHoraAgendamento":"2019-12-19T14:49:22.2-03:00"
}
]

I tried using importjson, but it failed. Should I create DW with group?
Thanks.
Kevin Ridley Accepted Answer Pending Moderation
  1. Tuesday, 7 January 2020 14:46 PM UTC
  2. PowerBuilder
  3. # 1

Where are you getting the JSON from?  Will there ever be more than 1 record in the nested array?  If you have any control over the JSON format, try requesting "flat" records instead of the nested array.  As Ken mentioned, nested arrays are not currently supported for ImportJSON.  You could always use the JSONParser to process the JSON and load either a DW or Treeview.

 

KR

Comment
There are no comments made yet.
Ken Guo @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 7 January 2020 09:39 AM UTC
  2. PowerBuilder
  3. # 2

Hi Rodrigo

 

There is a sub array nested in your JSON. This is not supported to be imported to the DW.

I suggest you delete that sub array or if the size of the sub array is 1, you can use common elements to replace the content on the sub array so that you dont need to use the array, in this way, it can be imported to the DW.

 

Regards,

Ken

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.