Question
IT Solution Service
SG
Last activity: 5 Oct 2022 2:55 EDT
Is it possible to parse Single Value property from Excel file using pxParseExcelFile?
Hello,
I am using Pega 8.7. I am trying to parse a Single Value Property from Excel file using pxParseExcelFile activity but it is not working. I have simply created a single property "MyProperty" under work class.
I have then created an Excel template file as below and uploaded it to Binary rule file.
Next, I created a button on UI and configured it to call pxParseExcelFile activity. I uploaded an Excel file with actual data but it doesn't work. When I used MSOParseExcelFile activity instead (deprecated in 8.1), then it works fine. As you know, MSOParseExcelFile was replaced with pxParseExcelFile in 8x and now we are supposed to use new one. From what I observed, I am starting to think pxParseExcelFile is only designed for a page list and it can't parse a Single Value property while MSOParseExcelFile can parse both page list and Single Value property. As a matter of fact, all information about pxParseExcelFile I find on Pega Community seems to be based on a page list only.
Can anyone let me know if my analysis above is correct or not?
Thanks,
-
Likes (1)
Cloe Walker -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
NCS Pte. Ltd
SG
Hi @CloeW938: Please find a related article with steps.
https://support.pega.com/question/pxparseexcelfile-not-parsing-file
Can you check if this helps?
Thanks.
IT Solution Service
SG
I already read this post and it is not answering my question. Again, my question is very specific - "Is pxParseExcelFile only designed for a page list and it can't parse a Single Value property while MSOParseExcelFile can parse both page list and Single Value property?" Is this statement correct?
If my assumption is wrong and pxParseExcelFile can handle Single Value property parsing, please paste a screenshot of how we can build it.
Thanks,
-
Cloe Walker
NCS Pte. Ltd
SG
Hi @CloeW938,
Please find the below.
Created a template similar to what is given.
Configured parsing using pxParseExcelFile. Able to get the results in my clipboard.
So, we are able to get single value property pared using pxParseExcelFile. But if you have another property mapping in the same column (lets say another property in B3) it is not working using pxParseExcelFile, where as it will work using MSOParseExcelFile.
Thanks
IT Solution Service
SG
Thanks. Can you please paste the screenshot of your activity?
IT Solution Service
SG
I have configured my activity exactly the same as yours, but it is not working. No error log is printed on PegaRULES.log file. I am calling the activity from button configuration, shown as below.
Are you calling your activity in a similar manner? If so, do you know why mine is not working and yours is working? I am using 8.7 and Theme Cosmos, but what is yours?
Regards,
-
Cloe Walker
NCS Pte. Ltd
SG
Hi @CloeW938: I'm using the same env config (8.7 with Theme cosmos). Can you please help to confirm below.
- Property, section, activity are in the same class or class which is accessible in inheritance path.
- What is the control you are using to upload the file?
Thanks.
Updated: 4 Oct 2022 23:01 EDT
IT Solution Service
SG
Thanks. Property, Section, and Activity are all in the same class (MyCo-MyApp-Work-Test). Here are the screenshots of all components:
1. Binary file rule
2. Excel template file (only one cell at B2 and that's it)
3. Property
4. Screen configuration
5. Activity called from button
5. Test Excel data that I am using (I filled in only one cell at B2)
Thanks. Property, Section, and Activity are all in the same class (MyCo-MyApp-Work-Test). Here are the screenshots of all components:
1. Binary file rule
2. Excel template file (only one cell at B2 and that's it)
3. Property
4. Screen configuration
5. Activity called from button
5. Test Excel data that I am using (I filled in only one cell at B2)
6. Test result - nothing happens. No tracer error, no PegaRULES error is found.
Notes:
If I use deprecated "MSOParseExcelFile" instead of "pxParseExcelFile", it works. That's why I initially thought "pxParseExcelFile" is designed only for Page List.
Regards,
-
Cloe Walker
Updated: 4 Oct 2022 23:08 EDT
NCS Pte. Ltd
SG
Hi @CloeW938, One observation from your screenshots.
pxParseExcelFile will not set the properties directly in your work page, instead it will set inside a embedded page named as pxSheets(Sheet name) (Please refer my screenshot earlier). Can you check in tracer if pyWorkPage.pxSheets(Sheet name) has values in it?
Thanks.
Updated: 5 Oct 2022 0:07 EDT
IT Solution Service
SG
Thanks. Here is a new finding:
- sheetWiseData checked
If I check sheetWiseData parameter, system created pySheets(Sheet1) under pyWorkPage and value is copied there. The class of pySheets(Sheet1) is classless. That's why I was not seeing value on screen.
- sheetWiseData not checked
If I don't check sheetWiseData parameter, system copied value onto pyWorkPage directly. This time, system didn't create pySheets(Sheet1) page.
Thanks. Here is a new finding:
- sheetWiseData checked
If I check sheetWiseData parameter, system created pySheets(Sheet1) under pyWorkPage and value is copied there. The class of pySheets(Sheet1) is classless. That's why I was not seeing value on screen.
- sheetWiseData not checked
If I don't check sheetWiseData parameter, system copied value onto pyWorkPage directly. This time, system didn't create pySheets(Sheet1) page.
So, I guess not checking this sheetWiseData parameter is simpler, because you don't need to copy it to pyWorkPage by yourself? Do you agree?
Regards,
-
Cloe Walker
IT Solution Service
SG
Thanks. I was wrong in that pxParseExcelFile still can parse Single Value property. However, when I try to parse an Excel file that is a little bit more complex with multileple Single Value properties and Page List like below, things still don't work.
1. Excel template file
2. Activity
3. Test data
3. Results - this is not what I expected. Page List is not copied. MyProperty1 should be Grape, and MyProperty3 should be Banana but wrong value is copied from the last row of that column. MyProperty2 and MyProperty4 are not even fulfilled as well as Page List.
Notes:
Thanks. I was wrong in that pxParseExcelFile still can parse Single Value property. However, when I try to parse an Excel file that is a little bit more complex with multileple Single Value properties and Page List like below, things still don't work.
1. Excel template file
2. Activity
3. Test data
3. Results - this is not what I expected. Page List is not copied. MyProperty1 should be Grape, and MyProperty3 should be Banana but wrong value is copied from the last row of that column. MyProperty2 and MyProperty4 are not even fulfilled as well as Page List.
Notes:
When I use MSOParseExcelFile, everything works perfectly fine.
This is the issue I initially wanted to talk about. Everyone tells me we should use pxParseExcelFile from 8.1 as MSOParseExcelFile was deprecated, but it doesn't really work. In real world the Excel is very complex, and there is no use case that Singe Value is only one row. Is this a bug, or is this designed intentionally for any purpose?
Regards,
-
Cloe Walker