3 Replies Latest reply on Jan 16, 2020 5:10 AM by Kevin Rexroad

    Cannot Stop Informatica from Escaping Special Characters

    Kevin Rexroad Active Member

      I'm attempting to call the MS Azure Cosmos API from Application Integration. I have had success connecting to Azure and querying the database. However, when I'm attempting to insert data into the Azure database, it is required to be in a json structure similar to this:

       

      {

          "id": "93909090",

          "doc": "Test String"

      }

       

      The problem is that Informatica is adding \ to my json/text string and as my luck would be MS Azure chokes on that input.

       

      My assignment looks like this, but I have had tried all kinds of tricks to get around this problem with no success.

       

      Assignment:

      '{"id": "' || $temp.DocumentID || '", "doc": "Test String" }'

       

      Output:

      {\"id\": \"Aja - BT\", \"doc\": \"Test String\" }

       

      • I've attempted to use concat instead of ||.
      • I have attempted to pass something in as XML and use the toJson function. The problem here is you cannot get rid of the header xml element and the json ends up looking something like this. Which does not work either in Azure.

      {"root":

           {"id": "93909090",

            "doc": "Test String"

           }

      }

      • I have attempted to use the replace function to eliminate the \, but that does not work either.

       

      Any ideas on how to over come this.