No internet connection
  1. Home
  2. General

JSON Parsing issues

By @matty
    2022-11-11 21:21:54.831Z

    Hi TA team,

    It would be nice to have the option to unescape json, there are cases where other systems (Mailchimp webhooks for example) send escaped JSON that can not be parsed by the "Read JSON" action, having an "Unescape JSON" operation would be very helpful.

    • 3 replies
    1. D
      Daniel Horton @daniel.horton
        2022-11-14 11:43:15.525Z

        Hi Matty,

        The Read JSON document was built to handle unescaped JSON. We have tested the functionality though and found a problem that will be resolved in our next release. This means that you will be able to handle your provider's content without any further functionality.

        1. M
          In reply tomatty:
          @matty
            2022-12-07 04:18:17.466Z2022-12-08 04:14:08.359Z

            Hi @daniel.horton

            I still can't seem to correctly read this json, even after the update, https://recordit.co/vU1XubS05i:

            {
            "mandrill_events": "[{"event":"reject","_id":"f7c200fb5f8f4d3997539f20ee32644f","msg":{"ts":1670373142,"subject":"Freight Quote Q1661830.","email":"adminstration@electronics.com","tags":["fbt-QUOTE","sr-SSHETRA","st-LTL"],"opens":[],"clicks":[],"state":"rejected","smtp_events":[],"subaccount":null,"resends":[],"reject":null,"_id":"f7c200fb5f8f4d3997539f20ee32644f","sender":"customercare@station.com","template":"transit"},"ts":1670373142}]"
            }

            or this:

            [{"reason":"soft-bounce","detail":"smtp;554 5.2.2 mailbox full; STOREDRV.Deliver.Exception:QuotaExceededException.MapiExceptionShutoffQuotaExceeded; Failed to process message due to a permanent exception with message [BeginDiagnosticData]The process failed to get the correct properties.","last_event_at":"2022-11-24 19:24:07","email":"epe@machine.com","created_at":"2021-05-04 20:34:46","expires_at":"2022-12-10 19:24:07","expired":false,"subaccount":null,"sender":null}]

            1. M
              In reply tomatty:
              @matty
                2022-12-08 07:26:42.996Z

                Also if I want to extract all the metadata values in this case it does not work:

                {
                  "event": "reject",
                  "_id": "aaef68429fb944578c959a6f9b44ff2a",
                  "msg": {
                    "ts": 1670443865,
                    "subject": "Shipment Rated: C1081319.",
                    "email": "a1@machine.com",
                    "tags": [
                      "BILL_SALES_AGENT",
                      "REQUESTED_EQUIPMEN",
                      "fbt-ORDER"
                    ],
                    "opens": [
                    ],
                    "clicks": [
                    ],
                    "state": "rejected",
                    "smtp_events": [
                    ],
                    "subaccount": null,
                    "resends": [
                    ],
                    "reject": null,
                    "_id": "aaef68429fb944578c959a6f9b44ff2a",
                    "metadata": {
                      "Alert": "REVISION"
                    },
                    "sender": "test@test.com",
                    "template": "sendrateafterconf"
                  },
                  "ts": 1670443865
                }