Best answer

is it possible to loop paths ?

  • 18 April 2020
  • 1 reply
  • 897 views

Userlevel 2

I use a API call to retrieve items in bulk , if there are more then 1000 entries , it gives me a __next option, I use paths to check if this __next option is returned and if true , I run a different API Call with this info. 

but I need to run this call as many times as the response returns this __next option  , I can do this with paths, but I want to re run the last path as many times as necessary , otherwise I need to code more then 50 paths to be sure. . . . 

is there a way to loop this ? 

so , call api call 1  
if response contains __next 
run api call 2
if response contains __next 
run api call 2 
and so forth 

So I want the path go back  and rerun the last path as many times as necessary 

icon

Best answer by andywingrave 18 April 2020, 12:32

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +9

This is a good question, and one I often come up against. The short answer is - It depends on what you’re trying to do, and what your Input/Output is.

 

I’ll provide a couple of scenarios and ways I’ve dealt with this:

 

  1. First off -  you could run a code step before it gets to your path to sort out all the data and give it the appropriate value. I’ve done this for quite a few bigger workflows with good results

But not everyone can write code, or wants to write code

  1. Another way to think about it could be dealing with the end state, and creating a zap for the path you’re referring to. One that literally takes all your data and then triggers an individual zap on each 

I realise these are both a bit advanced, and I’m quite sure there are many way to accomplish what you’re trying to do, but without knowing the applications, and the data you’re working with, that’s all I can suggest for now