[ardoJSON] JSONListify Output using double doublequote, problem when using JSON2RecordList

[ardoJSON] JSONListify Output using double doublequote, problem when using JSON2RecordList

  
Forge Component
(22)
Published on 24 Oct (4 weeks ago) by Ricardo Silva
22 votes
Published on 24 Oct (4 weeks ago) by Ricardo Silva


As you can see on above screenshot, JSON_Listify output was using double doublequote on key/name.

If those output JSON were passed throught JSON2RecordList, key/name was not recognized (see below screenshot)


Hope you can fix it, thanks.

OML attached.

Solution

Hello Harlin,

This happens because the output of the JSON_Listfy is in the form key/value, but you are providing a structure in the form name/value, so, because it uses reflection, it doesn't find the field.

If instead of the JSONAttributes structure, you use another one, replacing the name of the attribute "name" bu "key", it will work as expected.

Cheers,
Eduardo Jauch

P.S. I fixed a problem with the remove cycle as well.

Solution

Hi Eduardo, thanks a lot...

I also fixed some logic, it seems I can't use List_Delete with Loop's current row number.

Now it does List_Append instead if fields was used (not removed).

Everything's now good except JSON_Objectify still return a key/value JSON instead of expected Object JSON.

It seems JSON_Listify return key/value pair instead of name/value pair, while JSON_Objectify expect name/value pair?


Any thought?

I finally did it...

I replace Key/Value pair with name/value pair (case sensitive), and give "." value to Path (previously "$").


Thanks Eduardo for great support and RIcardo Silva for this great plugin.

huh?


Oh ... I see that I'm not using the same conventions in Objectify that I used in Listify.


Thanks for noticing. I'll update the component with these corrections asap. Probably to have Objectify use key instead of name since Listify has been there longer.

Version 1.10.1 of ardoJSON now takes key / value pairs instead of name / value pairs for JSON_Objectify. You can drop the weird conversions with this version :)

Great...

Thanks.

Ricardo Silva wrote:

Version 1.10.1 of ardoJSON now takes key / value pairs instead of name / value pairs for JSON_Objectify. You can drop the weird conversions with this version :)

Why don't also fix the JSONAttribute public structure too to key/value?

So, user won't have to create custom structure or accidentally/unknowingly used JSONAttribute public structure (name/value).


Honestly I didn't even remember that existed ^^

In any case, with the current case it cannot be used with either Objectify or Listify, so I see no reason to change Name to Key (specially since I prefer Name).