I would like to loop through a list of ID’s and for each of them:
- Make an GET request with the id
- If property “foo” is true, continue on to the next one
- If not, exit the zap
- Additionally, if all objects had “foo” as true, do an action
A simple javascript example might loop like:
var ids = >10,20,30,40];
for(var i = 0; i < ids.length; i++) {
var response = getDataForId(idsti]);
if( response.foo !== true ) {
break;
}
else if ( i === (ids.length - 1)) {
performAFinalAction();
}
}
Is there any way to both conditionally continue a loop based on data from actions in the loop as well as perform an action after the loop is complete (if it does complete)? I’ve been able to do one or the other, but not both.