Bulk file upload to SharePoint using SharePoint connector

Hello team,
I have a requirement where the bot needs to upload around 700+ files into a SharePoint for each queue items. Is there any way to bulk upload the files from one folder in local into a folder inside the SharePoint. Currently, i am using looping to get each files and then use “Upload Files” activity under Integrations>Microsoft365 activities to upload these file one-by-one. The issue is that this is taking too much time and is checking for an alternate solution. Requesting your help

Kindly note that the SharePoint location cannot be synced into local profile due to enormous size consumption.

1 Like

@NithinMA,

**Unfortunately no option to bulk upload the files to SharePoint.

You can also zip the files and upload but we will have to unzip them again once uploaded.

Update: Thank you @Anil_G, @Achiranga for highlighting that we can upload multiple files.

I tried this and yes, we can upload multiple files in one go. There isn’t any definite number of files but give it a try by splitting in chunks as Anil mentioned.

Here is how you can pass multiple files to Upload File

  1. Get all the local file full paths in an string array
  2. use this expression in Files property of Upload File activity strArrayFilePaths.Select(function (x) LocalResource.FromPath(x))

@NithinMA

2 Likes

Thanks so much for the quick response @ashokkarale . If i presume correctly, we won’t be able to unzip the file inside the SharePoint using any activity as well right? Please let me know. Thanks so much again

1 Like

That’s correct. If we have to open the file, user will have to download->unzip and then use it.

1 Like

Understood. Thanks again @ashokkarale

1 Like

@NithinMA

Welcome to the community

upload files support multiple at the same time as well I believe..you need to send lsit of iresources

may be not all 700 might support but can give a try..may be you can cut down to chunks of 100 or 50

cheers

2 Likes

I think bulk file uploads are supported. which accepts a collection (IEnumerable<IResource>).

2 Likes

Hello @Anil_G ,
Thanks for the welcome :slight_smile:

Regarding the multiple file option, yes it can support multiple files by adding them into arguments as shown below . I have tested it with 5 files and haven’t seen much speed improvement while doing this vs loop each file & upload (Not sure and this may be due to small data set being used for testing)

I haven’t been able to figure out how to get a collection to be passed into this argument so that the files are loaded at once. Additionally, the number of files inside the folder will be dynamic “Add entry” option might not be suitable here. I am not sure how i can get to build an IResource object collection from local file so that i can try passing it here. Requesting your expertise to see how this can be done, if possible.

Thanks so much in advance.

2 Likes

@NithinMA

directory.getfiles("Folderpath").Select(function(x) LocalResource.FromPath(x)) this will give you as enumerable of resource which can be used

once changed to list it shoudl allow you to pass the above query

if there is a limit you can use .chunk(50) so this will give 50 items per loop or iteration as one enumerable which can be sued in loop

for time difference try from robot and with a good number of files

sample of chunks

the currentTextArray contains 50 items from the give list if there are less it would handle if more then one more iteration will happen

cheers

1 Like