Upload data by using file listener combines with MSOParseExcelFile
To upload data by using an excel spreadsheet can be done by MSOParseExcelFile. The activity takes two mandatory properties, one is the name of the template file and the other one is the location and name of the uploaded excel file. The details steps of how to configure can be found here: https://pdn.pega.com/configuring-application-bulk-upload-data-using-excel-spreadsheet
When the parsing part is solved it will be great to make this automatically, Instead of uploading files one by one manually, it saves efforts to have a file listener monitors a folder and uploads files inside the folder when they are available. Here are the steps to set up the file listener and call MSOParseExcelFile to do the parsing.
- Create a Service File from Records→Integration-Services→Service File. Give it proper label, customer package name and customer class name.
- Configure the service file created.
- In Method tab, choose Processing method as "file at a time" and Data mode as "text only" since we are going to call MSOParseExcelFile to parse the file as a whole.
- In the Request tab, specify initial activity if needed. Skip the Parse segments and specify the final activity. One trick here is when the activity calls MSOParseExcelFile, I modified PRInputStream to java.io.FileInputStream in steps 3 java code to read uploaded file from an absolute path
- Also, the parameter TemaplateFRB for the MSOParseExcelFile activity, it follows the format: "webwb!TemplateName!xlsx"
- Create a file listener to monitor a folder and call the file service to parse the file content.
- Configure the listener node, source location and source name mask.
- Listener properties section will be the service file created in above steps 1 and 2.
- Provide Requestor login if required.
Keep up to date on this post and subscribe to comments
- File Listener doesn't process the uploaded files (Screenshots attached)
- When Moving a larger data file to file listener path while copying is in progress the file listener picks up the file and try to process it which is not fully copied.
- Is Export to excel functionality supported by Pega 7.1.9?? I have a requirement where i have to upload data through excel, in excel i can have property level validations, so it does not allow user to upload the file if the wrong data is entered. If in cas
- How to handle large data (around 100,000 records) in a file using a file listener.Is there any best option to achieve the same?
- File Listener: "You are not authorized to create, modify, or lock instance DATA-WORKATTACH-FILE" error displayed.