O7:Format JASON-string

Paul Mulroney pmulroney at logicaldevelopments.com.au
Thu Jan 7 05:01:36 UTC 2021


Hi All,

Graeme Reid wrote a routine to convert to/from JSON for Studio 5, which could be adapted to Omnis 7.   Check it out on Github:

https://github.com/graemereid/JSON_for_Studio5

It's pure Omnis code, and probably only needs adjusting slightly to suit Omnis 7.

Good luck!

Regards,
Paul.


> On 7 Jan 2021, at 11:53 am, Doug Easterbrook <doug at artsman.com> wrote:
> 
> 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
> 
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 




  <https://www.logicaldevelopments.com.au/>	Paul W Mulroney
Logical Developments
Customised Software Solutions
Ph: 08 9458 3889
 	We Don't Do Simple Pty Ltd
trading as
Logical Developments
ACN 161 009 374
 	  <https://www.facebook.com/logicaldevelopmentswa/>   <https://twitter.com/WeDontDoSimple>   <https://www.linkedin.com/company/logicaldevelopments/>   <https://www.youtube.com/channel/UCPldVVgWR05WX3cVrR5WUQw>


More information about the omnisdev-en mailing list