How to use Explicit wait with datatable

I have a scenario where I am working with database and setting up data for Processing, now once the processing is done the ProcessStatus Column gets updated to Processed. I need to verify the status and whether it is processed or not and give a Explicit wait until the status is processed, If there is an issue with processing it will update the column as number 10 which means issue with processing. So I have setup my flow using If loop before that I am converting the Database table to Data Table:
If Row(“ProcessStatusTypeId”).ToString.Contains(“4”)
Write Line - It is Processed
Write Line - Here i need to mention what the ProcessStatus is

How can I convert this into Explicit wait and verify what the Status is updated to?
I want to provide a wait and verify if the status is processed and if it is not processed then return the status number.

Hi @achawla

If I understood you correctly, you would like a trigger type of behaviour within your loop (or within the database activities?).

I don’t think this currently exists. However, we would need some clarification. Is the processing that sets your column value happening within your workflow (or another UiPath process), or does it happen externally?

Depending on the answer, there are some workarounds that could achieve what you are after, albeit in a slightly convoluted manner.

So what exactly is happening in the flow is in Database column i set the ProcessType to 100(Scheduled) and ScheduleDate to '2021-09-02 14:15:00.00 then at the backend it picks up the batch at the ScheduleDate so at 14:15 and then process it, once it is processed the ProcessType would then get updated to 4(Processed).
So in my UiPath workflow I am creating a flow where I am scheduling the batch via setting the time an the ProcessType and the moment when ScheduleDate matches with our SystemTime(CurrentTime) then it is processing and I am just validating the ProcessType if it got updated to 4 or not.
I tried to put a Delay according to the time i provided but sometimes its taking a minute or 2 to process and update the status. So I am trying to find a way to use Explicit wait so that it should validate the status when it is updated either processed or failed. I do not want to provide a Delay as that will be a set time.

Is there a way for your backend to do an extra action that we could use as a trigger for your automation?

For example, with file triggers, you could insert a trigger scope that awaits for a specific file to be modified/added to some folder. You could then have your backend write that dummy file when it’s done processing and your UiPath process would then detect it via the trigger scope and continue with the automation. Trigger scopes basically pause the workflow until a specific event happens (for example, recently we added a new trigger event, for an arriving email in your mailbox).

Another way would be to use Orchestrator and a combination of Orchestrator API and queue trigger. You could then use Orchestrator API and have your backend process add a queue item to a specific queue, which would then trigger automation and verify the processing.