Yes, exactly. Contacting the API endpoint maintaining the same variable specified in the form (basically sending the same request) in loop, until the comparison (for example, status==‘READY’) becomes true. While the loop is ongoing, showing a “Please wait…” message in the page until it finishes.
I have to hit automatically the API endpoint multiple times until the comparison becomes true.
The first time, the response could contain (status==‘XXX’), the second time (status==‘YYY’), and so on until the last response contains (status==‘READY’).
How can I do that with the “executing” state? I guess that even during the first call, the “executing” state is completed.
So you submit your form multiple times and not just submit it once, and then loop through all the returned results?
Maybe a more detailed explanation of how your API works would help to answer your question.
Yes, exactly. I want to submit the form multiple times (automatically) and loop through all the returned results until the comparison is true. Then, perform another action (like page redirection or something else). Also, I want to display a message during the loop.
How does your api work exactly?
Do you just need to submit the form and not change anything? Does it randomly return a record on each submit or how do you loop through them?
The “status” value (READY) is not what I enter (a variable provided by the input field). It is the value provided at some point by the API response after hitting multiple time the endpoint.