Forum Discussion

jsgeronimo's avatar
jsgeronimo
New Contributor II
8 years ago

Semantic URL Example

Hi,

I would like to know how to correctly pass data via Semantic URL (as a Triggered Task via URL)?

Here is what I did:

Edit Pipeline Properties:

I created an exampleId variable, if I wanted to pass a value of 1 to the exampleId variable:

https://elastic.snaplogic.com:443/api/1/rest/path/to/my/project/pipelineName/exampleId/1

What I have working is:

https://elastic.snaplogic.com:443/api/1/rest/path/to/my/project/pipelineName/?exampleId=1

18 Replies

  • Well, if I have this in one Mapper Snap:

    , and then I have that Mapper Snap followed by a second Mapper Snap, in which I have this:

    ,then in the output view of the second Mapper Snap I get this:

    I’m not sure that’s what you needed, but I guess, FWIW 🙂

    BR,
    Dimitri

  • Sometimes it’s useful to have a parent pipeline that executes a child pipeline and passes some values like these as parameters to the child. Then the child can reference them anytime (_parm) without having to keep passing the value along from one snap to the next. Especially useful when pipeline is doing things like document-to-binary where you can’t easily pass the values along.

  • Depending on your use case you can try the expression libraries too.

    I’ve created a couple of “helper” libraries that calculate things like File Paths which vary depending on the project or user or pipeline that’s calling them and then store the function in an expression library which gets loaded at run time in the pipeline. These can then act like global variables.

    eg I can then use “lib.helpers.file_path” in any snap and it’s always going to be correct and I never have to traverse the $original.original.original tree (something which gets very messy when you add another snap into the flow)