AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

Print JSON to a file
 
 

If I have a JSON object or array,

I found ^jsonwrite() to print it to the outputstream.

The only function I found to write to files is ^export.

Playing around I found that I can print it with some overhead like this:

$$jsoncontent = ^jsonwrite($$jsonobject0
^
createfact(JSONFILE JSONFILE $$jsoncontent)
@
= ^query(direct_sv JSONFILE JSONFILE)
^
export(myjson.txt @3

Sadly

^export(myjson.txt @3object

doesn’t seem to be working.

So how can I just write pure JSON, without any overhead, to a file to parse it in some other application?

 

 
  [ # 1 ]

^log

 

 
  [ # 2 ]

exactly what I was looking for, thank you.
I found this function is only described in the debugging manual. Maybe it would be helpful to add a reference to this function in the system functions manual, too. smile

 

 
  [ # 3 ]

ok

 

 
  login or register to react