Forum Discussion

srini_polimera's avatar
srini_polimera
New Contributor III
3 years ago

JSON array from external to snaaplogic using triggered task

Hi,

I am creating pipeline with triggered task and Json as input below. How to get this data into pipeline and use in mapper when postman is used to send request in body. I used ‘$’ in mapping, but no data is coming from postman.

“Input”: {
“item”: [
{
“SIGN”: “I”,
“OPTION”: “BT”,
“LOW”: “10”,
“HIGH”: “20”
}
]
}
}

–Thanks

5 Replies

  • bojanvelevski's avatar
    bojanvelevski
    Valued Contributor

    Hi @srini.polimera,

    You’re on the right track. $ should produce the data that you send in the body of the request, you just need to open an input view on the mapper.

    Let me know if this helps.

    Regards,
    Bojan

  • Hi @srini.polimera ,

    I would create an ultra task of the pipeline and then do a POST on postman to give the content with it.
    Example pipeline below with your data.
    In postman use bearer token authentication woth the token from the task then use the endpoint in the task and paste the input inside body with json selected:

    get_content_from_postman_2023_04_05 (1).slp (10.5 KB)

    If you are using a triggered task you can pass the input as query parameters because triggered is only with a get request (in my experience, wrong also possible with post check replies below) and access them through the pipeline parameter QUERY_STRING. Example below
    get_content_from_postman_triggered_2023_04_05.slp (7.1 KB)
    If someone knows a more efficient solution let me know

    Regards

    Jens