cancel
Showing results for 
Search instead for 
Did you mean: 

JSON array from external to snaaplogic using triggered task

srini_polimera
New Contributor III

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 5

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

JensDeveloper
Contributor II

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:
image
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

Hi @JensDeveloper,

I beg to differ.

Triggered task can be used with a POST method, by opening one input view and one output view.

image

Regards,
Bojan

Hi @bojanvelevski ,

Wow thank you for correcting me, haven’t used this option yet, It will make my pipelines much better.
So this is the corrected pipeline with triggered task.
My apologies for misunderstanding.
get_content_from_postman_triggered_V1.0_2023_04_05.slp (3.8 KB)

Regards

Jens