Upload File to SharePoint - File is uploading to wrong folder

My Question : Need to Upload file to SharePoint (SubFolder present in Documents tab) from local machine.

  1. I have a sharepoint. As we all know there will be few tabs in sharepoint like Home, Documents, Recycle Bin etc as per our comfort.
  2. In my SharePoint there is one tab called Documents. Under Documents there are many SubFolders like Input Files, Output Files, Raw Files etc
  3. Under one of the Sub Folder called Raw Files there are few folders. For eg we can take each folder is named with each Year and inside it again each month has each folder respectively
    Sample Folder Path Structure: Documnets/RawFiles/2026/March
  4. I need to upload file in above folder path.

My Solution:

  1. Used Microsoft Office 365 Scope activity and passed necessart details for authentication like Client ID, Secure Password and Tenant ID.
  2. Placed Find Files and Folders activity created necessary variables in properties
    First - Variable Named as FileName which is of DriveItem argument
    Results - Var Name das FileResults which is of Array of DriveItem argument
    Drive Name - “Documents”
    Site URL - I given Home Page URL of SharePoint
  3. Placed Upload File activity created necessary variables in properties
    File to upload : Passed the path of the file present in local machine
    Destination Folder : Passed Filename variable
  4. When I ran the bot file is uploading to “Documents/InputFiles/MyFile.xlsx”

I also gave Drive Name as : “Documnets/RawFiles/2026/March” but throwing error saying don’t have access to this folder which I do have

How to upload the file the correct nested folder inside documents folder?

TIA

Hey,

I think the issue is coming from confusion between Drive Name and folder path.

Drive Name should always be just "Documents" (the library)
not a full path like:Documents/RawFiles/2026/March

That’s why you’re getting access errors.

Try this :

In Upload File:

  • Drive Name → "Documents"
  • Destination Folder →

“RawFiles/2026/March”

I think it it uploads to wrong folder because :

Your Find Files and Folders is probably returning a different folder (like InputFiles), and you’re passing that instead.

So the key is:
Drive = library
Destination Folder = path inside it

that should fix it :+1:

Best regards,
Ghaith ABDESSALEM

Please verify that you are specifying Documenta correctly in your activity. In above, documents is misspelled. That also can be the reason of access error.

Also, I believe it is uploading to input files folders because you are giving first path as your destination.

Now it depends on how you have configured your find folders activity. To me, it seems that bot is uploading to the the first folder it is encountering. If you need to upload to a different folder instead, you will need to provide appropriate condition/query for bot to return driven of that folder.

Hope this helps.