RobotUi
(UiRobot)
February 9, 2024, 6:43pm
1
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.
ppr
(Peter Preuss)
February 9, 2024, 6:59pm
2
When using UiPath.System.Activities Package Version >= 2023.10.1
use:
{UiPath.Platform.ResourceHandling.LocalResource.FromPath(currentItem)}
EDITED: fixed BUG
1 Like
ppr
(Peter Preuss)
February 9, 2024, 7:04pm
3
When using UiPath.System.Activities Version lower then < 2023.10.1
then try:
and use:
{myLocalResource}
when it is not working let us know which version of the UiPath.System.Activities is used
EDITED: fixed BUG
1 Like
Anil_G
(Anil Gorthi)
February 9, 2024, 7:08pm
4
@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
Anil_G
(Anil Gorthi)
February 9, 2024, 7:16pm
5
@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
2 Likes
ppr
(Peter Preuss)
February 9, 2024, 7:21pm
6
As an alternate when using UiPath.System.Activities Package Version >= 2023.10.1
We can avoid the For each by
And the modelling:
Directory.GetFiles(in_Config("YourKey").toString.Trim).Select(Function (x) UiPath.Platform.ResourceHandling.LocalResource.FromPath(x)).toList
2 Likes
system
(system)
Closed
February 12, 2024, 7:21pm
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.