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:
- Get File/Folder of the destination folder using drive item ID
- 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
- 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:
Subfolder value would be: “sub1/sub2/sub3”
Query value would be: “123456” (the documents in sharepoint would be 123456_1.pdf 123456_2.pdf)