How to upload files to sharepoint?

Hello experts,
I am using User Onedrive & sharepoint activity from Microsoft.Office 365- classic package.

I am looping in folder to get the file name and upload it to sharepoint, but File (s) parameter is asking me for IEnumerable how to solve this to upload file to sharepoint ?

Thanks in advance.

When using UiPath.System.Activities Package Version >= 2023.10.1

use:

{UiPath.Platform.ResourceHandling.LocalResource.FromPath(currentItem)}

EDITED: fixed BUG

When using UiPath.System.Activities Version lower then < 2023.10.1
then try:
grafik
grafik
and use:
{myLocalResource}

when it is not working let us know which version of the UiPath.System.Activities is used

EDITED: fixed BUG

@RobotUi

Use path exists inside the for each folder and pass currentfile

Then the output of path exists will give ilocalresource

Where you can give thw output in upload files as {outputofpathexists}

Cheers

@RobotUi

Also new upload files can upload multiple files at same time so you can avoid for loop as well by using

System.IO.Directory.GetFiles("PathHere").Select(function(x) UiPath.Platform.ResourceHandling.LocalResource.FromPath(x))

cheers

1 Like

As an alternate when using UiPath.System.Activities Package Version >= 2023.10.1

We can avoid the For each by
grafik

And the modelling:

Directory.GetFiles(in_Config("YourKey").toString.Trim).Select(Function (x) UiPath.Platform.ResourceHandling.LocalResource.FromPath(x)).toList
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.