Aggregating JSON and \\\ characters

Hello all

I wonder if someone can help me.

I am aggregating JSON together to create one JSON file. All is working well, but something I don’t quite understand is why Make adds several \ escape characters to the generated JSON. The JSON is storing plain text with no special characters.

An example is as follows:

Input = {"Col A":"18:00 (Approx)","Col B":"Anton, Elaine, Andrew travel Denver","Col C":"Travel","Col D":"Travel","RowStyle":"black/white","Format Column":"Col C"}

Output = {\"Col A\":\"18:00 (Approx)\",\"Col B\":\"Anton, Elaine, Andrew travel Denver\",\"Col C\":\"Travel\",\"Col D\":\"Travel\",\"RowStyle\":\"black/white\",\"Format Column\":\"Col C\"}

I am using 3 “Aggregate to JSON” modules in a row. In the above example, one \ is converted into \\

Again - my JSON seems to be working in the script I am sending it to, but I have to remove all the \ programmatically, which seems like a wasted step?

Thanks,
Andrew

You might have inserted the variables into a string field, or a field that is interpreted as a string, hence the output has to be escaped to be a valid JSON. Without knowing how your scenario and modules are set up, can’t really say more.

2 Likes

Thanks loads for this.

I read various variables from Airtable - then create an array and map some variable names to get the values I need.

My JSON Data structure does have the fields set to “Text” - so a JSON string is being added to a Text field inside a Data structure - could that be it?