Forum Discussion

ext_benp's avatar
ext_benp
New Contributor
2 years ago
Solved

Writing to Pipeline Parameters within Pipeline

Is it possible to set Pipeline Parameters within a Pipeline - e.g. from a Mapper. To be clear I don't want to read a Pipeline Parameter I want to set it.

I would like to set a Pipeline Parameter to contain a business identifier, e.g. Invoice ID, or Employee ID etc. and from here, it may be possible to provide some sort of Audit capability.

  • jfpelletier - assuming this input document:

    {"ids":["r4ige6rwgvnr","4nkmdoijydfj9","6ashbd99w3"]}

    Configure a Mapper expression as follows:

    Should provide the desired output.  Take a look at the Array.map() documentation for description.  The Javascript documentation linked in the SnapLogic documentation has some excellent details and examples.  Basically the statement shown above is turning each string value in the array to an object.

     

4 Replies

  • SpiroTaleski's avatar
    SpiroTaleski
    Valued Contributor

    ext_benp 

    I don't have a child pipeline (and I don't want one). I think the Pipeline Execute Snap only works if I was calling a child pipeline, Correct? - > Yes. You can set the pipeline to invoke itself with the Pipeline Execute Snap(and set the needed parameters), but its not an ideal solution 😄 

    And yes, I don't think that you can set the pipeline parameters without passing it from the parent process or external REST call. 

    Looking at your case, I guess your pipeline is exposed as a REST endpoint, so either:

    •  you can pass the InvoiceID, EmployeeID as a query parameters while calling the pipeline
    •  or store the parameters in a file(SLDB or any other external file locations), database table, SnapLogic Tables etc. 
    • ext_benp's avatar
      ext_benp
      New Contributor

      Thanks for your responses. You have confirmed my suspicions. It does seem a gap that SnapLogic is unable to provide business metric audit capability without not insignificant customisations.

       

  • SpiroTaleski's avatar
    SpiroTaleski
    Valued Contributor

    ext_benp 

    You can utilize the Pipeline Execute Snap to call the pipeline and pass/set the pipeline parameters. In the pipeline on which you will pass/set the parameters, you can capture the parameters: 

    So, in the Dashboard -> Execution Status -> Pipeline Parameters, you will be able to see what have been set for the captured parameters. 

    • ext_benp's avatar
      ext_benp
      New Contributor

      SpiroTaleski 

      I don't have a child pipeline (and I don't want one). I think the Pipeline Execute Snap only works if I was calling a child pipeline, Correct?

      I am trying to achieve something like the below where Audit Invoice ID could set a Pipeline Parameter before completing. 

      I strongly suspect this approach won't work, I am trying to see if I can get some Audit capability out of SnapLogic without having to create special pipelines and messages which would impact performance.