Similar (the same?) to this other topic: Interval not firing when action called as “execute action” step - Help & Support
- UI Bakery Community.
Problem: Interval is not executing when the action it is in is called from another action.
Context: I have a REST API that has async functions. You start some work, then need to wait for it to complete. I have an action that uses interval to act as a while-loop with a built in delay, checking the satatus. Then I call that “Wait for Done” action from other actions that start async work.
Details
I have an action called “waitForFunctionComplete”:
- Setup
- Interval
- REST API call
- Finish
The interval looks like this:
The REST API is a GET call to my API. It comes back with a JSON object with a status, and if done, with content. My plan would be to have the status cause the interval to end, but not there yet… The response does come back correctly.
I would expect that when it runs it would infinitely call checkStatus, then wait three seconds, and check again because I have no exit condition. And when I run it from Execute action button that is what happens.
However, I have another action:
- Setup
- Save to State (make UI show data is loading)
- REST API that triggers an asynchronous action
- Save to State (store the async functions ID so the Wait action can use it)
- Execute Action (the above “waitForFunctionComplete” action)
- Save to State (store the results into state for later use)
- Save to State (make UI show data is done loading)
- Finish
It will start the async action, then calls the action I described above. The action does get called, gets the correct state to make the status call, and returns a “correct” result.
When I run this action using the Execute action (or when it is triggered by UI action), the interval occurs once (without the 3 second wait) and the response comes back immediately. If the work happens to be done - great all is good. If not, then getting the list of things fails (the work is not done).
I suspect this is a bug in the interval not actually looping as described in the documents: Interval | UI Bakery Docs
I have no dialogs - it is a simple single page at the moment with two Select controls. The goal is to have Select1 trigger an action that generates a list for Select2, and Select2 to trigger this action which would fill a table. Select1 works (REST call is not async so no wait needed), and Select2 fails if it takes too long (that is if the first status call doesn’t come out with “done” and all needed data).

