How to build uploading CSV file function

Hi,

In this post, I will share how to build uploading CSV file function to Page List using pxUploadCSVResults activity. Please see attached for the tutorial.

Upload CSV file overview.gif

This document includes the following tips:

  • How to handle embedded page (pyWorkPage) and top page (non-case context)
  • How to avoid PRRuntimeException error
  • How to allow Japanese characters in the Shift-JIS formatted CSV file
  • How to map different names between header in CSV file and actual properties

* Related topic

The usage of all the combinations of upload / download CSV / Excel file is summarized at https://support.pega.com/discussion/handling-files-thru-user-interface.

Hope this helps.

Thanks,

HowToBuildUploadingCSVFileToPageList.xlsx (2.5 MB)

HI @KenshoTsuchihashi

Hope you are doing well.

The post is extremely helpful and detailed.

I have also implemented the a similiar requirement in my project but got stuck with an issue which has got me to this post.

Just wanted to know if you faced something similiar or not.

Issue:

  1. I am using “File Path with Form” control from the flowaction pxUploadCSVResults

  2. Without uploading the file, if press submit it gives me an error

  3. Now second time, if i upload a correct file and try to progress it results in same error.

It seems that “hiddenfilepath” remains blank if I upload the file after any errors.

It works fine , if i initiate the whole process again.

Did you face anything like this?

Regards

Bhavya

@Bhavya Hi, Before the Refresh Section event on the before, call one more DT or activity to clear the error messages before uploading a file.

@KOMARINA The first step in the activity is to clear the error messages so that doesn’t help. As i said, its not able to pass the hiddenfilepath on second upload.

@Bhavya I was using similar functionality to upload file and parse in Pega to do some processing and i am able to process it after i get an error without having to initiate the whole process, only difference is i am parsing an excel file instead of a csv. I am sure you might have set all the params right, but please check again, here are my params

Hi @KenshoTsuchihashi

I tried the above process are rai it through casetype…I am facing error.

All the properties are Text Input…Even if I run the Flow individually, I am facing the same error.

FYI… I have only configured “Basic” implementation and I still haven’t implemented “Handling Top page”

@itzreddyv

My customer was able to make it by following the How-to document, so it must be either your code or CSV file. Please go through the document to see if your code is missing anything. If not, then suspect CSV file. Validate if property name exactly matches header name. Get rid of “Address” column from the file and try one by one to identify the bottleneck.

Also, you can’t have space in the header name like “Phone number”. Even if you enter space in between when you create a property, PRPC will trim it. Having space in the CSV file should lead to the same error as yours, shown as below.

The reference Phone number is not valid.  Reason: invalid property name: 'Phone number'

Thanks,

Hi @KenshoTsuchihashi

The problem is with the CSV file. I downloaded a sample CSV file from google and uploaded it. It worked as expected but why is the CSV file that I created is not working. Both these files have same headers.

CSVFiles.PNG

Hi @KenshoTsuchihashi

When we create a CSV file sometimes the values could get corrupted while saving, that’s the reason for error. After creating the CSV file, if we save-as the file again(new file or replace the file), then we can upload it without any error.