O365 Scope / Find in Files & Folders

Hi, does anyone have any samples on how to navigate folders/sub folders & files within Onedrive using the O365 scope. ?

The example at https://docs.uipath.com/integrations/docs/office365-find-files-and-folders gets me so far.

I’m looking to pull all PDFs from a “Process” subfolder" from the root
Do some processing (which i’ve got and is working)
To then move the PDF I’ve just processed into a folder from the root called “Archive” and then a sub folder called “Success”

As I’m moving PDF’s around this structure I notice that the original query of “*.PDF” is actually returning a count of the PDF’s in all the sub folders rather than just the initial subfolder.

I can navigate to the “Archive” folder using the “Find Files & Folders” activities and then to what I think is the “Success” folder - sometimes I error with “Object not set to an instance of” type error, other times the file sits in the “Archive” folder but then errors on any Moveitem or Copyitem/Deleteitem.

Couldn’t see a way of combining folders & wildcards e.g. “\Process*.PDF” or subfolders “\Archive\Success” … these scenarios error too.

Any assistance - gratefully accepted


Where you able to solve this? I am having the same question.

Kind of … I got round it rather than finding a specific fix … put a Try Catch round the moveitem then in the catch do a deleteitem … that suppresses the error and the delete works. You might be able to find the exact exception being raised - I just trapped any exception.

Can’t remember where I got to with navigating the folder structure - reading up on the way files & folders are stored in Azure as objects rather than any folder & files structure - I’m assuming the Query activity does only take a pretty simple search string, returns the DriveItem array and this it’s up to you to iterate through it to find the object you’re interested in ie a specific folder … webURL seems to hold the path to the object

Hope this helps