Is there any OOTB activity that Import a CSV into a Datatype
We have a requirement where we want to import a CSV file from a shared location into a Pega Datatype. The CSV files placed at shared location are Exported from a Datapatype from another Application.
We want to do this through an activity invocation by an REST service. I have tried invoking the activity @baseclass.pxUploadCSVResults but it is failing stating the Properties from Source and Destination are not matching.
The Properties available in Exported SCV are avaliable in Datatype and they are same.
We are working on Pega 7.2.1
Please help me on this.
Thanks and Regards,
Maruthi Naidu Kurupati.
***Updated by moderator: Lochan to add Categories***
If it is through Rest Service, i don't think the input wil be excel file, it might be XML or JSON and if so, we can loop over the records in the xml/JSON and map each record to the page of required data type and save the instance
Thank you for your response. Through REST service will be passing the file name and Datatype Class name as parameters to it, which will invoke an activity which should read the CSV file and import the file to DataType.
The Activity @baseclass.pxUploadCSVResults will take class name and Page name as parameters to import the CSV files, but some how it is not working.
I used the same activity @baseclass.pxUploadCSVResults to import a CSV file and passed the class name, page name and pagelist name and it worked for me. Try passing the PageListProperty parameter along with the other two. The pagelist class and the importing properties must belong to thesame class. It should probably work.
Create an excel template which maps the excel column to the properties in page list. Then pass excel template and the actual excel sheet to the MSOParseExcelFile activity, it will map all excel columns to properties.
I have a requirement where I need to read data from a CSV file with two columns which is placed in the server (C://xxx) and then save the data of one of the column from the CSV to a DB table. I have tried using MSOParseExcelFile, it gives error saying the " the template and file doesn't match". pxUploadCSVResult doesn't have parameter to pass the location. Can anybody suggest any approach to achieve this requirement.
This can be achieved through MSOParseExcelFile. This is demonstrated in Pega Designer Studio from Pega landing Pages -> Application -> Profile -> Requirements. In the Actions drop down, Import from Excel. If you explore design, it may help you to achieve it through MSOParseExcelFile
I tried before using MSOParseExcelFIle, it was giving format mismatch error. I need to parse CSV file but the code of MSOParseExcelFIle says that it checks the format of file as"xlsx". I will try again, please let me know if you can make out anything which I am missing.