08-26-2020 02:21 PM
I am trying to get an expression library from the Github API and save the content into a file in Snaplogic. When I get the content from the GET snap, it has \n characters and doesn’t recognize them as actual new lines. I then use the Width Formatter snap in order to get Snaplogic to recognize the \n characters as new lines. However, once I pass this into the File Writer snap, the file that was saved has no new lines, and the entire expression library is on one line.
Do you know how I can get Snaplogic to save the file with the new lines, formatted correctly?
09-04-2020 03:00 PM
I am able to parse it, however it puts the keys in quotes and still doesn’t put any new lines in the file.
After running JSON.parse in the mapper, the output looks like this:
{
“object” : {
“source_1” : “website”,
“source_2”: “website”
}
}
After JSON formatter and file writer, the saved file looks like this:
{“object” : {“source_1” : “website”, “source_2”: “website” } }
09-05-2020 08:10 PM
Try checking the “Pretty Print” checkbox in the JSON Formatter. This should put the \n characters in.