Discussion

Retrieving file name from File Listener

Does anyone know how to retrieve the file name of a file the File Listener picks up and starts processing?

***Updated by moderator: Marissa to close post***

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Comments

Keep up to date on this post and subscribe to comments

June 3, 2008 - 4:31am

Check your File Listener Rule. In the Process tab, your can specify a page for reporting. As default, it is named LogServiceFile and is of class (guess...) Log-Service-File .
Within this class, there is a property pyOriginalDirectory and pyOriginalFileName which contain the values you need.

June 3, 2008 - 5:42pm

Thank you very much, this worked exactly as you described.

March 24, 2016 - 6:45pm

How can I find the name of the file being processed by my file listener.   I'm generically listening on a directory for a *.csv file.   I need to know the name of the file for my logic.

According to   https://pdn.pega.com/forums/integration/retrieving-file-name-file-listener   I can look at the LogServiceFile page and get the name from the  pyOriginalFileName property.When I run the service manually and pass in a local file name I don't see a value for pyOriginalFileName on the clipboard page.   I see other valid stats like the record count but not the file name.

Thanks John

 

 

April 8, 2016 - 6:13pm
Response to JohnB381

The solution suggested above does not work if you are testing the connection and providing a local file.   Otherwise it does work.