cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with get files

Sofia
Level 3
Hi!

I am having problems with file management. Get files.
What is happening to me is that if I run the process manually, it brings me the files in the collection, but when I throw it in the control room, the process ends without doing anything.
From what I was seeing, when it runs by itself, adding an action that counts the number of rows in the collection, it returns 0, that is, it doesn't bring any file and I don't understand why.

I am using BP version 6.7.2

Did someone have this problem?

Thanks a lot!


------------------------------
Sofia
------------------------------
8 REPLIES 8

NicholasZejdlik
Level 9
I'd ensure the files exist on the target machine, and check the Success and Message outputs from the Get Files action. If it has a problem retrieving the files (such as an authorization issue), it will let you know via those two outputs.

------------------------------
Nicholas Zejdlik
RPA Developer
------------------------------

PvD_SE
Level 12
You may even get a better understanding of what's happening if you step through your process and into the Get Files action. Sometimes there's more info there than is shared with the process calling the action.

------------------------------
Happy coding!
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)

Hi Sofia

As luck would have it I recently had this same issue and resolved it. Is this a shared folder/address? In my case I was mapping shared folders to a drive on the machine and this worked fine when accessing through the process manually. However when I run the process on its own through scheduler it returns 0 files or directory doesn't exist errors. I was set the path to the files/folders as it appears on the machine e.g. Y:\My shared folder\Business Folder\My File but when we run this in the scheduler we need to exclude the drive letter so it reads the explicit path which, in this case, would be \\My shared folder\Business Folder\My File

Removing the drive letter resolved this for me so hopefully its a similar issue you are having and can resolve it the same way.

Hope this helps 🙂


------------------------------
Michael ONeil
Technical Lead developer
Everis Consultancy
Europe/London
------------------------------

Hi @Sofia,

Have you received ans ?​

------------------------------
Nilesh Jadhav
Senior RPA Specialist
ADP
India
------------------------------
Nilesh Jadhav.
Consultant
ADP,India

jhogelp
Level 8
Hi Sofia.

In the input parameters of the Get Files action in CSV Patterns, place "*" test if it brings you the files from the path you passed in the folder.
If it works for you manually unattended by the control room it should work.

I hope I've helped !!

Cheers

------------------------------
Jhogel Ponne
Senior RPA
Ernst & Young
America/Panama
------------------------------

VivekGoel
Level 10
Hi Sofia, Check Michael ONeil 's Answer, If you are accessing the shared drive, the path  would be probably causing the issue. Instead of a drive mapping the folder, use "\\" to refer to the network drive,

------------------------------
Vivek Goel
Submit Your Built solution for "The" RPACULT 2020- The Unique RPA Hackathon of 2020.
http://therpacult.com
------------------------------

sonuiiml
Level 5

Better late than never. 😄

Well I  had the same problem and just wanted to share what worked for me. 
So if I want get all excel files in folder Y:\My shared folder\Business Folder then the folder path and the pattern should be written as 

Folder Path: Y:\My shared folder\Business Folder\
Pattern: "*.xlsx"
Please keep in mind to include the additional back slash "\" at the end. not including it works fine while running from control room and process studio i.e if we keep it like Y:\My shared folder\Business Folder

However, while running through scheduler, "\" needs to be included at the end of the folder path. 

Cheers. 



------------------------------
Susamay Halder Consultant
Consultant
Bruce Power
+1(437)217-1086
------------------------------

KirtimalaMadye
Level 2

Imports System
Imports System.IO

Public Module Program
Public Sub Main(args As String())
Dim inputFolderPath As String = "D:\BluePrism" ' Change to your input folder path
Dim inputFileStartName As String = "Orders_Sample.xlsx" ' Change to your file prefix

Try
Dim dtCreateTime As DateTime? = Nothing
Dim outLatestFile As String = String.Empty

For Each eachFile As String In Directory.EnumerateFiles(inputFolderPath)
Dim fileInfo As New FileInfo(eachFile)
If fileInfo.Name.StartsWith(inputFileStartName, StringComparison.OrdinalIgnoreCase) Then
Dim fileLastUpdateTime As DateTime = fileInfo.LastWriteTime
If Not dtCreateTime.HasValue OrElse dtCreateTime < fileLastUpdateTime Then
dtCreateTime = fileLastUpdateTime
outLatestFile = fileInfo.Name
End If
End If
Next

If String.IsNullOrEmpty(outLatestFile) Then
Console.WriteLine("No file found matching the specified prefix.")
Else
Console.WriteLine("Latest file: " & outLatestFile)
End If
Catch ex As Exception
Console.WriteLine("An error occurred: " & ex.Message)
End Try
End Sub
End Module