REST: itterating over a variable (in my case chapter number)

0
Hi, As you can see I am trying to call a rest service in oder to get information on a specific chapter. Unfortunately, information on all chapters in not available so I just want to increase the chapter number everytime as I go through this loop so that I can get information on all the chapters that are avaiable. The problem is when it calls a false address then it just breaks the flow. My ideas was to check the status code and continue with the loop. I don’t want to loop to break even when I call a false address. What can I do in this case? Thanks  
asked
3 answers
1

You can try Custom without rollback error handling on your REST call.

Something like this

answered
1

visit : https://docs.mendix.com/howto/logic-business-rules/set-up-error-handling

See Custom without rollback or Continue in error hanling.

answered
0

Hi Manish,

You could continue as you described. I don’t really know how many chapters you’re dealing with so that is something that you could keep in mind while continuing.

A better option would be to discuss whoever created the API to formulate a better way to get this data rather than you looping and sending individual chapters which may or may not even have data!

For instance, you can check with the other party to see if they can send data related to the chapters in one go (note this again depends on the amount of data the API would return). But this feels more of a discussion with different parties and arriving at a better solution.

Hope this helps!

answered