Office365 activity - Find Files and Folders

Hello,

I’ve been experimenting with the office 365 integration activities recently. I got the office 365 scope, find files and folders, and the download file activity to work.

However, I noticed that the find files and folders activities can only find up to 200 driveitems. Does anyone know how to modify this? in my test case, I’m trying to download as at least a thousand driveitem/files from sharepoint.

Any help would be greatly appreciated.

Thanks.
Regards,
Sen

Hi @MensenLijauco ,

This is the expected behaviour for the “Search items” API from microsoft.graph (please see Search for files - Microsoft Graph v1.0 | Microsoft Learn for more details) which the “Find Files and Folders” activity is using.

In the documentation of the API it is stated: " If there are too many matches the response will be paged and an @odata.nextLink property will contain a URL to the next page of results."

Please try accessing the URL from that property in a loop until the property is not found anymore in the response and let me know if this solves your use-case.

Constantin

Thank you for your reply. I quite new to this and I was wondering what activity to use to see and access the @odata.nextLink and how can I incorporate it to the find file and folders activity?

Thanks.
Regards,
Sen

Hi @MensenLijauco ,

I did a little bit of digging and it seems that this is a known limitation in the current implementation of the activity (version 1.6 of Office365 activities package). We will remove it for Office 365 version 1.8.0 (probably sometime in the next couple of months).

I have asked if there is any workaround for this case in the meantime and will come back to post if any viable solution comes up.

Constantin

So, I got a response - the only workaround at this time is to define a filter that returns max 200 items. I don’t know if it will fit to your particular use-case.

Constantin

Thank you, Constatin. I decided to abandon the activity and just use the .Getfiles() to return all the contents of the sharepoint folder. Your responses, however, were greatly appreciated.

Regards,
Sen

Hi @Constantin_Dumitrascu,

It seems this limitation is still not removed yet, even with version 1.9.

Would you have any updates on this?

Thanks!

Hi @Constantin_Dumitrascu,

we are currently using package Version 1.9.0 and the issue seems to still be not resolved.

Using filters (Query) does not help as apparently the activities limits the response to 200 before filtering.
We determined this by changing the queried filename so it is first alphabetically.
e.g.
Query = “HelloWorld”, Filename = “00_HelloWorld.xlsx” (first alphabetically) → result: file is found
Query = “HelloWorld”, Filename = “ZZ_HelloWorld.xlsx” (place 218 alphabetically) → result: file is not found

So your workaround is also not working.

As a dirty workaround we now have to synchronize the sharepoint folder with the local file system to us file-system-activities/functions.

Can you give us an update on this issue?

Thanks
BR
Richard

1 Like

Definitely would like an update. I feel synchronizing sharepoint with local file system (mount) isn’t recommended as we’ll have to do it on every applicable VM.

I believe this will need to be expedited as more orgs look to adopt the use of SharePoint over network folders.

Hey guys,

This work around of renaming the Sharepoint Document Library Drive Names doesn’t work all the time. I tried renaming another document Library with the prefix 00_xxx and it wasn’t able to be found. I’m not entirely sure why since this should be found before the 200 cap.

Alternatively the new Office 365 Activities Version has a new method called For Each Files/Folders

This is used to get past the 200 search limit, and just tested this out successfully through a bit of playing around due to the lack of some documentation. However if you want to search for items using the SharePoint parameters, you should make sure you specify the original Document Library name (not the one that you renamed the library name to 00_xxx for example). Since the activity acts as a for each loop, you should initialize a variable to the Drive Item and apply If Conditionals to filter out any duplicates you find (Example: You may have two folders that have the same names, so I also apply a conditional based on WebUrl)

Alternatively the Sharepoint Drive Link (Specific Url) parameters can help find the drive item(s) you want. This works for both folders and files you want to search.

Also as a note, I believe the activity https://docs.uipath.com/activities/docs/office365-get-item-info is only really good with the old find files and folders activity since Drive Name is a necessary argument. The problem is again not finding this Drive Name/Document Library so you won’t be able to pull the drive items within that Drive. My exception message even when not specifying the Drive Name is “accessDenied”.

1 Like