Preserving JSON formatting in Pipeline Builder

Hello! Any advice on maintaining JSON formatting (whitespaces, indents, etc) as the JSON moves through various transforms? I care about the visual representation as well as the technical ability of the JSON to parse after it is written to the ontology as an attachment property.

Context: In Pipeline Builder, I flattened/tabularized a large JSON as I needed to update/insert into one of the very nested structs. I then wrote this tabular data to a data set which is backing an object type in my ontology. I then access the ontology in code repository to create instances of a new object type, which contains an attachment property that I designated as JSON.

Upon generating and viewing the resulting attached JSON, I noticed that it lost all of the visual formatting that I expected the JSON to have, although it could be parsed. In code repository, I am using JSON.stringify(combinedjson, null, 2);. Noting that I tried to custom format the JSON in the code repository and in AIP Logic with no success (failed and not supported, respectively).

Appreciate any prior art or advice on implementing this properly. Thank you!!!

1 Like

Hey @asohrabi, is your JSON field a struct type in Pipeline Builder? Or a string