How to make a ajax call and show result on same page?

We have a custom UI consuming the flowable rest API, Currently, in our application, we have a search box, the result is showing on the next (task) form, We want to show the result under the search box without moving to the next task. Is it somehow achievable?

I’m not following your use case? If you query for tasks, they do not get completed. But I assume the search does something else than simply displaying the tasks?

The Usecase is
UserTask(with form) ---- > serviceTask(getting product list details from DB) ----- > UserTask(showing data coming from the serviceTask) —> UserTask(user select one product )------>ServiceTask(sending sms to user)------> end;

So, We have do UserTask and ServiceTask on the same page so that we can show the search result on same page.