Is there JSON format variations?

Hi

I’m sending data across my server to a desktop program. We were hoping to pass the data in JSON format. When I .stingify a variable it returns a long string with no carriage returns.
e.g

["3281",[{"descr":"Donkey scan for pregnancy","code":"LA-DONKEYSCAN","uom":"Each","quantity":"7","Price":39,"note":"","milkwithhold":"","meatwithhold":"","treatment":""},{"descr":"Premix blend","code":"MINMPREMIX","uom":"Each","quantity":"100","Price":1095.85,"note":"Used for bulk premixes from Agvance","milkwithhold":"","meatwithhold":"","treatment":""},{"descr":"Arrest C Drench 1L","code":"D-ARRESTC1L","uom":"Each","quantity":"30","Price":59.64,"note":"","milkwithhold":"","meatwithhold":"","treatment":""},{"descr":"Advantage Cat < 4kg SD","code":"ADVANCATS","uom":"Each","quantity":"150","Price":10.76,"note":"","milkwithhold":"","meatwithhold":"","treatment":""}],"&nbsp;","&nbsp;"]

`

The guy writing the desktop software is expecting JSON data in this format. Which is the same with carriage returns for what ever reason. “viewing pleasure”?

[
   "3281",
   [
     {
	"descr":"Donkey scan for pregnancy",
	"code":"LA-DONKEYSCAN",
	"uom":"Each",
	"quantity":"7",
	"Price":39,
	"note":"",
	"milkwithhold":"",
	"meatwithhold":"",
	"treatment":""
     },
     {
	"descr":"Premix blend",
	"code":"MINMPREMIX",
	"uom":"Each",
	"quantity":"100",
	"Price":1095.85,
	"note":"Used for bulk premixes from Agvance",
	"milkwithhold":"",
	"meatwithhold":"",
	"treatment":""
     },
     {
	"descr":"Arrest C Drench             1L",
	"code":"D-ARRESTC1L",
	"uom":"Each",
	"quantity":"30",
	"Price":59.64,
	"note":"",
	"milkwithhold":"",
	"meatwithhold":

Is there a way of getting the second format? I could write a routine if needed but didn’t want to reinvent the wheel.

Here’s the answer in full gory detail:

I think the paremeter ‘space’ is what I’d need. This not an option in AS?

It’s valid. Sometimes the AppStudio docs leave out all the options on the function. However, since AppStudio acts as a wrapper for these call, the options on the additional pages will work. :slight_smile: