cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to replicate the logic equivalent to while loop in Snaplogic pipelines

MuraliNagula
New Contributor

There is a child pipeline which returns values like completed, in queue, processing etc. The requirement is that parent pipeline to run this child pipeline till it returns Completed, of-course after certain wait time. Its like while loop, run the child pipeline, till the expression is true. How do accomplish this in snaplogic ?

Appreciate any pointersโ€ฆ

14 REPLIES 14

MuraliNagula
New Contributor

Unfortunately the response object for this Marketo Endpoint doesnโ€™t have โ€œHas Nextโ€ or โ€œNext URLโ€ attributes. Otheriwse my life would have been much easier !!!

You can find the details of the response object etc in the following link.

https://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Bulk_...

GET /bulk/v1/leads/export/{exportId}/status.json

https://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Bulk_...

The โ€œnextโ€ properties are expressions. So, I would think you could write an expression to check the response to the status request to see if it was completed or not. If it was completed, the โ€˜Has Nextโ€™ expression should return false, otherwise it should return true. The โ€˜Next URLโ€™ can just be the same as the main Service URL property.

cstewart
Former Employee

In the documentation for the REST Get Snap, there is an example for response form marketo:
REST Get Pagination: Marketo
For Marketo, set:

Has Next: resultdoc.moreResult
Next URL: โ€œ/rest/v1/activities.json?nextPageToken=โ€ + resultdoc.nextPageToken + โ€&activityTypeIds=1&activityTypeIds=12โ€

The difference is rest vs. bulk call.

christwr
Contributor III

The API for the child triggered task doesnโ€™t have to return โ€œHas Nextโ€ or โ€œNext URLโ€ properties directly, just something you can evaluate in expressions for those attributes in the REST GET snap.

For example:

2019-06-24_8-06-17

Or whatever type of expression that returns true/false based on whether you want the REST GET snap to do againโ€ฆ