Forum Discussion

gremishe's avatar
gremishe
New Contributor
6 years ago

Removing [] from output of the triggered pipeline

Hi,

We have a triggered pipeline that returns JSON.
Here is the example of the output:
[
{“metadata”:{“version”:“1”},“content”:[{“elementType”:“detail”,“title”:“Gleb”,“content”:}]}
]

The problem is that brackets are causing the issue for the vendor that calls this pipeline.
How do we remove brackets?

Here is the desired output:
{“metadata”:{“version”:“1”},“content”:[{“elementType”:“detail”,“title”:“Gleb”,“content”:}]}

Thank you,
Gleb.

6 Replies

  • If you are using a JSON Formatter and the pipeline will only return one document, you can just check the “Format each document” option.

    • gremishe's avatar
      gremishe
      New Contributor

      I don’t see how this will help me.
      I do not need to transform the JSON.
      I just need to remove the first square bracket and the last square bracket.
      The rest of the JSON should stay as is.

      When I generate JSON, I do not have the square brackets. Looks like Snaplogic adds them.
      What can I do so the square brackets are not added?

      I appreciate your help.

    • gremishe's avatar
      gremishe
      New Contributor

      Not really.
      In this one, the square brackets are showing up int the preview, but his REST POST worked.
      In my case I do not have REST POST. It’s just open ended JSON Generator.