Hi there, I am unable to upload folders I have download today to the Sharepoint. I am not sure if my looping is incorrect or UiPath is not allowed to access the Sharepoint. Can someone please assist?
Image below is in a for loop
Hi there, I am unable to upload folders I have download today to the Sharepoint. I am not sure if my looping is incorrect or UiPath is not allowed to access the Sharepoint. Can someone please assist?
Image below is in a for loop
Hi @hirz
Welcome to the UiPath Community!
The https://docs.uipath.com/activities/docs/copy-folder-x activity belongs to UiPath.System.Activities which generally contains activities that work at System level, i.e. File IO (Input/Output), File/Folder Operations, Write Text Files, etc.
If you want to move/copy a file to SharePoint, you need to use activities designed with that purpose. Essentially, since SharePoint is an online location, you would need to Upload a file/folder there, not Copy/Move.
You may use one of the following:
For option #2 above, you will need to do some explicit setup, but it will help if you are planning more than just SharePoint upload, e.g. Email management, Excel, OneDrive, SharePoint lists, etc.
I hope this clarifies the doubt.
Hi @RPAForEveryone ,
Thank you for the advice. I have already tried using that method and it does not work.
Is it possible that the reason why it is not uploaded is because of the restricted access that I have for Sharepoint since this is not a personal account?
If you are able to manually upload files/folders to the SharePoint site, then it should work with the activity too.
Maybe if you could share the error message from that activity, preferably with screenshots, the community can help you.
HI @hirz
Have you checked on this thread?
Regards
Gokul
Apparently, there is no error message.
I have put this in Sharepoint Application Scope > For Each Folder in Folder > If
If there is no error message, does your workflow complete successfully?
In that case, are you able to verify if the file/folder got uploaded to SharePoint?
My other workflow is done correctly but i am stuck at this part. I want to upload the files i have downloaded i have today and upload it to the sharepoint. Which is why the loop to see the thru in the download folder and if the download folder is modified today, upload it to sharepoint.
Hi @hirz
I suspect this is due to the wrong activity being used for folder creation.
According to the SharePoint Custom Activities package page, there are two separate activities for files and folders:
Try using Create Folder
for each folder and then Upload File
for files in each folder.
Hi @RPAForEveryone ,
As shown in the picture, I have put it in the open application and used CreateFolder yet it does not work. Could it be because UiPath is not allowed to access Sharepoint?
Yes, not having access to SharePoint could certainly cause issues.
Can you please share the error message?
There is no error message for this, however, the looping was not gone thru
Hi have you use the test connection button?
and are you sure the user youre using to acccess sharepoint have the authorization to write / edit the folder?
Hi, I did test connection button. Im pretty sure that the reason to why folders cannot be uploaded is because of the granting for using UiPath
if you can manually open/edit the folder using you account , then uipath should have no problem accessing it using your account
Hi, i have tried to do it locally in my laptop but still not working. Is my IF not done correctly?
Hi,
I’ve been pulling my hair for the whole day trying to figure out how to make this work.
My Sharepoint Application scope is set up properly and working, because previously to uploading a file I’ve been able to successfully create a remote folder.
Uploading a file, though, it’s becoming impossible.
I’ve been trying the same value for “Item URL” in the Upload file activity as in my successful “Create folder” activity, something my common sense says should work (but as the documentation is crap and there’s no mention about it, who knows). Then in the “Local Path” field I’m using the ABSOLUTE path of the file (with the filename itself). And I’m getting different output error messages, like “File not find” and “Access denied” (sometimes even with the same values; ain’t that weird?).
As it didn’t make sense to me, I started playing with the values. Like adding and removing trailing and leading slashes, using the full path of the SharePoint URL (as the field sayys “Item URL”)… but no luck.
Finally I swapped off both field values, as I’ve learned that UiPath is prone to make this sort of dumb bugs (that, moreover, don’t get fixed over the course of the years even if they are aware of them), and then I got the weridest of the wierd errors:
“Upload file: Could not find a part of the path ‘C:\Users\Admin\Documents\UiProjectsFolder\MyCurrentProject\Documentos\General’.”
The RelativeUrl value is the absolute path of the filename I pretend to download.
The LocalPath valued is “Documentos/General”, the Teams (or SharePoint) library path I want to upload the file to.
So, as you can see, it seems the activity it’s using LocalPath as the value for the file to upload, but silently adding the ABSOLUTE path where the files of the PROJECT you are running are stored ('C:\Users\Admin\Documents\UiProjectsFolder\MyCurrentProject"), and then it adds the name of the file… which, to my understanding, needs to be INSIDE the project folder. No way to upload files from outside the project, then?? What the heck is this? How are we supposed to figure out that if there’s no mention to it in the docs, dudes? And I have yet to test if that really works and what the value for the RelativeUrl (or “Item URL”) should be.
Using “…/…/” style paths to get out of the project folder is not feasible, either.
Any hints would be really appreciated, as well as providing any method for uploading the whole contents of a folder, including subfolder to any potential levels (and please don’t suggest uploading them one by one, as I need it to be recursive regarding nested subfolders, and I’m not gonna reinvent the wheel here).
Thanks everybody (exceptiong UiPath staff, who seem either to be on vacation, have abandoned the ship, went on bankrupcy or whoever knows, even if their product licenses cost a gazillion).
So to keep with the weridness:
Then for “Relative URL” it doesn’t matter what I put in there: I either get the “File not found” error or “Could not find the file ‘C:\README.md’” (weird, ah? that’s outside project folder…) if I put an inverted slash (“\README.md”) before the name of the file.
Ok, I finally found out.
In case someone is facing this:
In the “Local path” field you gotta write the full, absolute URL of the file you want to upload, including the filename + extension themselves (i.e., in the form of “c:\temp\my\file.txt”)
In the “Item URL” field you have to write the parth of the URL that belongs to the main documents folder and its subfolders IN THE WAY YOU SEE IT FROM Microsoft Teams OR FROM THE SharePoint SITE, CONTRATY TO WHAT YOU DO IN THE “Create Folder” activity, that holds a path format whoever knows how to find out if it’s not by trial & error.
In my case, the “Item URL” looks like
“Documentos compartidos/General/My own made documents folder”
UiPath staff, you gotta hire me…