O7:Format JASON-string

Doug Easterbrook doug at artsman.com
Thu Jan 7 03:53:31 UTC 2021


hi all:

we only built it for Studio as an xcomp …. Never did it for classic.        In those days, XML was king.

sorry, we have nothing to shortcut the process.


but feel free to adapt it if you like.  as far as I know, it handles all the cases of nesting that JSON throws at you.




we still use it extensively in Studio 10.1 & 2

Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On January 6, 2021, at 3:12 PM, Phil (OmnisList) via omnisdev-en <omnisdev-en at lists.omnis-dev.com> wrote:
> 
> If your into creating externals, then maybe this is a possibility from David Mckeone of Artsman:
> https://github.com/dmckeone/Omnis-jsoncpp
> 
> Its for Studio, but might give you enough to make it work for Omnis 7?
> 
> regards
> Phil Potter
> Based in Chester in the UK.
> 
> On 06/01/2021 23:00, Phil (OmnisList) via omnisdev-en wrote:
>> Hi Daniel,
>> 
>> Omnis 7 - JSON - I suspect JSON came after O7 development ceased.
>> 
>> I suspect the only way is for you to write a procedure to do it for yourself.
>> 
>> Currently I believe Studio functions would create a row/list variable which may include other list row variables for the multi part sections, like items, and types...
>> 
>> Maybe someone else wrote something before, but I don't know of an O7 external or anything to do it for you.
>> 
>> If you have a later Omnis Studio, you might want to try out its functions to see what it does, so you can try and replicate it in code?
>> 
>> regards
>> Phil Potter
>> Based in Chester in the UK.
>> 
>> On 06/01/2021 19:50, Daniel Sananes wrote:
>>> Hallo
>>> 
>>> Is there some code or other tool that I could implement in Omnis 7 to format a JSON-string so it will be readable.
>>> Below is a string received from an API-call:
>>> [{"depo":{"srsId":"0002547061341"},"items":[{"number":"902","name":"Helpall Grå","types":[{"value":0,"name":"OK"}]},{"number":"901","name":"Helpall Svart","types":[{"value":0,"name":"OK"}]}]},{"depo":{"srsId":"0002547061358"},"items":[{"number":"901","name":"Helpall Svart","types":[{"value":0,"name":"OK"}]}]}]
>>> 
>>> I would like to extract the information and put the values into variables.
>>> 
>>> This JSON thing is new to me but I know it is a common subject here in our forum.
>>> ---
>>> 
>>> Best regards to everyone.
>>> 
>>> Daniel
>>> 
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com
>> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com



More information about the omnisdev-en mailing list