How to find count of target system table before performing the sync using sync editor

I want my sync project to first check the count of data in the target system first and if the count is not null then it should start the sync.

Issue: I have multiple target system tables which can be null sometimes due to timeout issue. So in the current scenario, when the sync runs and it doesn't find any data in the target tables then

as per the workflow its deletes the data which only exists in one identity manager.

Workflow: Objects only found in One identity manager - Delete

So I wanted my sync project to connect and then check the count of the tables first, if its not null then it can start executing the workflows as per the mappings.

Any idea how to achieve this ?

Thanks in Advance Slight smile