30
Views
5
Comments
[ardoJSON] Listify multiple levels of JSON
Question
ardojson
Service icon
Forge asset by João Barata
Application Type
Service

In the JSON_Listify demo, the output is not valid because the third key of "director" has a value which contains an array rather than a string. Is there a way to use ardoJSON to turn the entire JSON string into valid key/value pairs?

2022-12-30 07-28-09
Navneet Garg

Yes this is the issue with JSON in OutSystems. Direct array can not be handled due to key is converted as structure.

I faces same issue with following json ( in my case array of arrays) 

can you please share your json ?

2022-01-05 23-55-28
Dan Kozlowski

I understand that this is a limitation of OutSystems, but I thought this was the issue ardoJSON was supposed to solve?

So in the example of a list of movies, is there a way to "listify" the entire thing?

{

  "title": "The Lord of the Rings: The Fellowship of the Ring",

  "ReleaseDate": "2001-12-19T00:00:00",

  "director": { "firstName": "Peter", "lastName": "Jackson" },

  "SCORE": 8.8,

  "actors": [ 

    { "name": "Elijah Wood", "plays": "Frodo Baggins"}, 

    { "name": "Sean Astin", "plays": "Samwise 'Sam' Gamgee"},

    { "name": "Sean Bean", "plays": "Boromir"},

    { "name": "Cate Blanchett", "plays": "Galadriel"},

    { "name": "Ian Holm", "plays": "Bilbo Baggins"}

  ],

  "keywords": [ "ring", "hobbit", "doom", "middle earth", "quest", "epic" , "bravery"]

}


2022-12-30 07-28-09
Navneet Garg

As checking your JSON i think it will work

create a structure with the JSON and try to assign output to structure and check.

Or possible please provide oml to check at my end.

2022-12-30 07-28-09
Navneet Garg

In your json listify will not work because the director is not an array. it is a object

"director": { "firstName": "Peter", "lastName": "Jackson" }, 

it will work for actors

2022-12-30 07-28-09
Navneet Garg

If your director will be an array then it will work. here is the example.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.