Forum Discussion

swatifunde's avatar
swatifunde
Contributor
3 years ago
Solved

How to pass parameter in JSON generator snap

Hello Community,

Can you please help me to understand how can I pass or is it possible to pass parameter in JSON generator snap.

Below snapshot for reference

Please advise me to correct it

  • @swatifunde

    It is possible. You will need first to set the pipeline parameters(in Edit Pipeline Properties):
    ex:

    The path in your JSON Generator configuration for accessing the parameters looks correct.

    Also, I am attaching sample pipe as an example.

    JSON_Generator_Param_2022_11_07.slp (2.5 KB)

    BR,
    Spiro Taleski

2 Replies

  • ryagnik's avatar
    ryagnik
    New Contributor

    Thanks I was able to get done with child pipeline here.

    I am wondering why parser looses the header such as $[“content-location”]

    If we can have a flag on parser to preserve those headers, we would be able to accomplish all in one pipeline ?

    • stodoroska's avatar
      stodoroska
      New Contributor III

      You can also add Binary to document to the FileWriter, after that a copy snap, then document to binary and csv parser. After the csv parser you will add a join snap, where you will join the output of the copy snap and the output of the csv parser where you will have the $[‘content-location’] and the output of the parser.

      But join is an expensive operation, so I am not sure with how many records are you dealing with in this pipeline. This is just a suggestion of a possible way how to implement it in a single pipeline.