Hi. I have this flow where I loop through projects, list some configuration details, and then update them.
The problem I have is that some of the projects don’t have configurations and return a 403 error. This is fine with me, I just want the loop to go onto the next item.
However, when it isn’t an error and needs to go to the Update call I need to also pass the project id field, so I’ve linked that from the loop. (the highlightes one in the screenshot below)
When I run it with this link it just ends after the first 403 error rather than continuing through all the projects.
When I remove the id link it works and loops through all the projects, but the updates fail because they don’t have the {{proj{{ parameter.
I’ve tried putting the project id into a variable but it never contains the right value when it gets to the update. I’ve tried putting in IFs and Evaluates to handle the 403 error or force the next value in the loop.
I think the Update call waiting for the variable is stopping the loop going to the next step.
How can I pass this parameter value to the second call when some of the first calls may fail?
Is this possible?
Thanks
Hi @mission-cosmologist4
Welcome to the forums!
You’re on the right track with the if/condition block that’s the easiest solution here. Connect the success and failure ports of the first API call for configurations and check the status code if it’s 403 then do nothing, if it’s not 403 then send the id and execute all your evaluate blocks etc.
Basically your update configurations call has to receive either all of it’s inputs or none for the flow to work as expected. So in the error case it receives nothing and in success it gets all the values.
Let me know if this works for you!
Happy to jump on a call if you’re still running into issues.
Thanks Daniel,
I have the IF statement working, but how do I pass the project_id from before the IF to the call after it?
The Project_id isn’t returned on the GET configurations call, I only have it from the first step of the loop. How can I pass it to the last step of the loop?
Thanks.
Do you have an updated screenshot?
Might be easier to use a condition block as it allows passing through everything defined at the top. After I see your screenshot I can give you more specific advice 
Basically I still have the same problem. I need to get that id to the parameter in the last call, but bypassing the middle call or IF causes it to stop if there’s a 403.
Do I need to append the ID to the body so that it’s available to use later?
create a variable from the id (add a create variable block and connect it to the id select), and reference it in the downstream block.
You can use a condition block it works similar to the if block but it passes every name input as a value outside of it so you can pass in your body and the id and then select each after the block if your condition is met.
The Condition Block did the trick! Thank you!
The variable block didn’t work for me, by the time it was calling the second POST call, it had already updated the variable with the next value, so I was getting the wrong value in the POST.
1 Like