Json Object and Array

Posted by goo on 08-Oct-2018 13:18

11.7.3

I have this Array by doing this:

{&out-long} oJSData:GetJsonArray('data'):GetJsonText().

How to hek do I get this without the [] in front and after? I have tried so many things, but not found the correct, and before I start removing, I just have to ask. The worst is that I have made it myself ...

help….

[{"current":1},{"total":"1119"},{"rowCount":"1119"},{"rows":[{"CustNum":2097,"Name":"Bonnie's Sports & Trophy Supl","RowIdent1":"0x00000000000004b4","RowCount":10,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2098,"Name":"John's Custom Archery Pro Shop","RowIdent1":"0x00000000000004b5","RowCount":9,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2099,"Name":"Arctic Gunworks","RowIdent1":"0x00000000000004b6","RowCount":8,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2100,"Name":"Western Auto","RowIdent1":"0x00000000000004b7","RowCount":7,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2101,"Name":"Bob's Guns & Sporting Goods","RowIdent1":"0x00000000000004b8","RowCount":6,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2102,"Name":"Lighthouse Grocery & Liquor","RowIdent1":"0x00000000000004b9","RowCount":5,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2103,"Name":"Alaska Fisheries","RowIdent1":"0x00000000000004ba","RowCount":4,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2104,"Name":"Alaska Par T Golf Pro Shop","RowIdent1":"0x00000000000004bb","RowCount":3,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2105,"Name":"All Weather wear","RowIdent1":"0x00000000000004bc","RowCount":2,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2106,"Name":"Apocalypse Design Inc","RowIdent1":"0x00000000000004bd","RowCount":1,"jbCountDistinct":1,"jbAverage":0.0}]}]

Posted by goo on 08-Oct-2018 13:20

Sorry, suddenly I see that I have made a mess out of this :.-) too many objects….

All Replies

Posted by goo on 08-Oct-2018 13:20

Sorry, suddenly I see that I have made a mess out of this :.-) too many objects….

Posted by Mike Fechner on 08-Oct-2018 13:22

You have a JSON Array? And want a representation without the outer square-brackets?
 
SUBSTRING is your friend. The JSON Object Model classes are not capable of producing invalid JSON.
 
Von: goo <bounce-goo@community.progress.com>
Gesendet: Montag, 8. Oktober 2018 20:20
An: TU.OE.Development@community.progress.com
Betreff: [Technical Users - OE Development] Json Object and Array
 
Update from Progress Community
 

11.7.3

I have this Array by doing this:

{&out-long} oJSData:GetJsonArray('data'):GetJsonText().

How to hek do I get this without the [] in front and after? I have tried so many things, but not found the correct, and before I start removing, I just have to ask. The worst is that I have made it myself ...

help….

[{"current":1},{"total":"1119"},{"rowCount":"1119"},{"rows":[{"CustNum":2097,"Name":"Bonnie's Sports & Trophy Supl","RowIdent1":"0x00000000000004b4","RowCount":10,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2098,"Name":"John's Custom Archery Pro Shop","RowIdent1":"0x00000000000004b5","RowCount":9,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2099,"Name":"Arctic Gunworks","RowIdent1":"0x00000000000004b6","RowCount":8,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2100,"Name":"Western Auto","RowIdent1":"0x00000000000004b7","RowCount":7,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2101,"Name":"Bob's Guns & Sporting Goods","RowIdent1":"0x00000000000004b8","RowCount":6,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2102,"Name":"Lighthouse Grocery & Liquor","RowIdent1":"0x00000000000004b9","RowCount":5,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2103,"Name":"Alaska Fisheries","RowIdent1":"0x00000000000004ba","RowCount":4,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2104,"Name":"Alaska Par T Golf Pro Shop","RowIdent1":"0x00000000000004bb","RowCount":3,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2105,"Name":"All Weather wear","RowIdent1":"0x00000000000004bc","RowCount":2,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2106,"Name":"Apocalypse Design Inc","RowIdent1":"0x00000000000004bd","RowCount":1,"jbCountDistinct":1,"jbAverage":0.0}]}]

View online

 

You received this notification because you subscribed to the forum.  To stop receiving updates from only this thread, go here.

Flag this post as spam/abuse.

Das Bild wurde vom Absender entfernt.
 

Posted by goo on 08-Oct-2018 13:22

Got it

{"current":1,"total":"1119","rowCount":"1119","rows":[{"CustNum":2097,"Name":"Bonnie's Sports & Trophy Supl","RowIdent1":"0x00000000000004b4","RowCount":10,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2098,"Name":"John's Custom Archery Pro Shop","RowIdent1":"0x00000000000004b5","RowCount":9,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2099,"Name":"Arctic Gunworks","RowIdent1":"0x00000000000004b6","RowCount":8,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2100,"Name":"Western Auto","RowIdent1":"0x00000000000004b7","RowCount":7,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2101,"Name":"Bob's Guns & Sporting Goods","RowIdent1":"0x00000000000004b8","RowCount":6,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2102,"Name":"Lighthouse Grocery & Liquor","RowIdent1":"0x00000000000004b9","RowCount":5,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2103,"Name":"Alaska Fisheries","RowIdent1":"0x00000000000004ba","RowCount":4,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2104,"Name":"Alaska Par T Golf Pro Shop","RowIdent1":"0x00000000000004bb","RowCount":3,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2105,"Name":"All Weather wear","RowIdent1":"0x00000000000004bc","RowCount":2,"jbCountDistinct":1,"jbAverage":0.0},{"CustNum":2106,"Name":"Apocalypse Design Inc","RowIdent1":"0x00000000000004bd","RowCount":1,"jbCountDistinct":1,"jbAverage":0.0}]}

Posted by onnodehaan on 08-Oct-2018 13:32

Hi,

You write that you created the array yourself. Why not create an object? And place all rows inside, the object?

Posted by goo on 08-Oct-2018 13:38

I got it :-) I had created objects instead of properties :-) I saw it when posting this :-)

Sendt fra min iPhone

8. okt. 2018 kl. 20:34 skrev onnodehaan <bounce-onnodehaan@community.progress.com>:

Update from Progress Community
onnodehaan

Hi,

You write that you created the array yourself. Why not create an object? And place all rows inside, the object?

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

This thread is closed