Root Folder not found when searching SharePoint using Find Files and Folders Activity

Hi Everyone,

I am attempting to upload a file onto SharePoint using the Find Files and Folders activity in the Microsoft Office 365 Package. I left the query field empty in the Find Files and Folders activity which told me that it will use the root folder. I can get back my files in my root folder but my root folder does not exist. I know this because I passed DriveItem.Folder into a message box and I get back "Object Reference not set to an instance of an object ". My root folder is null for some reason and that is preventing me from uploading files. I attempted to pass in my root folder name into the query field and that throws and “Access Denied, the user does not have right permissions” . This is odd because I have all the permissions in SharePoint. I can download files as well so I dont believe that I do not have the permissions because I can return all the files and list them in a message box. Does anyone have a clue on what is going on here? I may be passing in the wrong information to the fields. I have attached a photo below to show you guys what im passing in. Sorry, i can only upload one photo as i am a new user.

1 Like

Hi welcome to the community!
That package is not SharePoint specific, what you are using there is for OneDrive. Maybe you will want to work with this instead:

You are right, it is not SharePoint specific but its supposed to work with SharePoint and onedrive. The Docs confirms that as well.

“The Microsoft Office 365 Files activities provide methods to search for files, move and copy files hosted on OneDrive and SharePoint.” - https://docs.uipath.com/integrations/docs/files-onedrive-sharepoint

You are right, it is not SharePoint specific but its supposed to work with SharePoint and onedrive. The Docs confirms that as well.

“The Microsoft Office 365 Files activity provide methods to search for files, move and copy files hosted on OneDrive and SharePoint.”

It will work, but Sharepoint will not make it any easier for you in terms of permissions, checked out files etc… If you need specific SharePoint stuff, you should use the other package, but ofc it will be your choice.

Does it work for SharePoint online too?

Yes it does.

Alright, there is a pretty big downside to using that activity. I cant do queries with it. Do you know if that exists in it. Because I cant see where you can insert a query.

What do you need to find in SharePoint?

I need to go over SharePoint document libraries and retrieve files that have a keyword in their filename. I also need to search certain depending on the date.

Hello! were you able to do it using Office365 activities?

Hi, welcome to the community!
If you are only working with SharePoint, i recommend you install that package above and not the Office365 one as it is harder to configure.

1 Like

oh! Thanks!