Office365 Find Files and Folders not working as expected

Hi, I am using Find Files and Folders activity with Office365 scope (AppID and Secret) but it does not seem to be returning the correct results. The overall idea of the process is to store documents after renaming it with their billing number. If there are same doc numbers present, will just add a counter at the end, for example: 123456_1 and 123456_2.
This is what I have done so far:

  1. Get File/Folder of the destination folder using drive item ID
  2. Find Files and Folders where the query is the billing number (Example: “123456” so it should return all files that start with it) and store into an array
  3. Move File/Folder. New name field is the doc number + the array.count +1

However, what I have noticed is that the find files/folder activity is not very consistent and it is sometimes returning the wrong amount. Example would be if there were 4 documents (same doc number) in the sharepoint, it only returns 1 result in the find files and folders activity which will cause the logic for move file/folder to fail since there is an existing document of the same name.
Below are the properties for the activity:
image
Subfolder value would be: “sub1/sub2/sub3”
Query value would be: “123456” (the documents in sharepoint would be 123456_1.pdf 123456_2.pdf)

@CC_Pet

Are you uploading those file in the code only?

Are they completely uploaded or synced?

If using in loop try to end the scope and start the scope for eqch item and check if that resolves

Also did you try with changing the version?

Also query might be case senstive…check that once

Cheers