Closed
Solved
getting error while using pxConvertStringToPage function
While using pxConvertStringToPage function,I'm gettng below error message ' Unable to perform ConvertStringToPage, due to invalid inputs. What might be causing this?
***Edited by Moderator Marissa to update categories***
Try add step Page-New targetPage before step with with pxConvertStringToPage . I've got similar issue on 7.3.1:
My datatype was O1T7RB-B73b-Data-Test with following fields:
- A: Text
- B: Text
- C: TrueFalse
- D: TrueFalse
- E: ValueList (Text)
Defined sample Activity which takes json as input param Param.testjson
It had just 2 steps:
step1: @(Pega-RULES:Page).pxConvertStringToPage(tools, Test, Param.testjson, "json")
step2: use values from Test page..
where Test=O1T7RB-B73b-Data-Test
Then on section I defined button to run my activity with testjson = {"A":"aa", "b":"bb", "C":"true", "D":true, "E":["e1","e2"]}
Observations:
- fields A, C, D and E were set correctly, so bool values works both with and without quotation marks
- field "B" was not set, because in testjson it is with lowercase.
Then I modified O1T7RB-B73b-Data-Test by adding Text and FieldGroup properties and then remove both of them.
Try add step Page-New targetPage before step with with pxConvertStringToPage . I've got similar issue on 7.3.1:
My datatype was O1T7RB-B73b-Data-Test with following fields:
- A: Text
- B: Text
- C: TrueFalse
- D: TrueFalse
- E: ValueList (Text)
Defined sample Activity which takes json as input param Param.testjson
It had just 2 steps:
step1: @(Pega-RULES:Page).pxConvertStringToPage(tools, Test, Param.testjson, "json")
step2: use values from Test page..
where Test=O1T7RB-B73b-Data-Test
Then on section I defined button to run my activity with testjson = {"A":"aa", "b":"bb", "C":"true", "D":true, "E":["e1","e2"]}
Observations:
- fields A, C, D and E were set correctly, so bool values works both with and without quotation marks
- field "B" was not set, because in testjson it is with lowercase.
Then I modified O1T7RB-B73b-Data-Test by adding Text and FieldGroup properties and then remove both of them.
After that pxConvertStringToPage stopped working and in text file exported from Tracer I saw:
<pagedata>
<pzActivityParams>testjson=%7B%22A%22%3A%22aa%22%2C+%22b%22%3A%22bb%22%2C+%22C%22%3A%22true%22%2C++%22D%22%3Atrue%2C+%22E%22%3A%5B%22e1%22%2C%22e2%22%5D%7D</pzActivityParams>
<pzHarnessID>HID7633ADCD115BC2EF773F2C96A9C69B9C</pzHarnessID>
<pzPrimaryPageName>pyWorkPage</pzPrimaryPageName>
<pzTransactionId>d5309c160ff1fc5c1991fb990308a9a4</pzTransactionId>
<errorMessage>Unable to perform ConvertStringToPage, due to invalid inputs.</errorMessage>
<UITemplatingStatus>N</UITemplatingStatus>
<AJAXTrackID>1</AJAXTrackID>
<testjson>{"A":"aa", "b":"bb", "C":"true", "D":true, "E":["e1","e2"]}</testjson>
<pzFromFrame>pyWorkPage</pzFromFrame>
<ClientInt>Start</ClientInt>
<pyActivity>pzRunActionWrapper</pyActivity>
<inStandardsMode>true</inStandardsMode>
<pzActionID/>
<pzActivity>xyTestActivity</pzActivity>
</pagedata>
I fixed it by adding step Page-New: Test before pxConvertStringToPage step. No there is no error and Test is filled as expected:
<pagedata>
<pzActivityParams>testjson=%7B%22A%22%3A%22aa%22%2C+%22b%22%3A%22bb%22%2C+%22C%22%3A%22true%22%2C++%22D%22%3Atrue%2C+%22E%22%3A%5B%22e1%22%2C%22e2%22%5D%7D</pzActivityParams>
<pzHarnessID>HIDCEF88324F1E68E710CC40BBA0157A1DF</pzHarnessID>
<pzPrimaryPageName>pyWorkPage</pzPrimaryPageName>
<testjson>{"A":"aa", "b":"bb", "C":"true", "D":true, "E":["e1","e2"]}</testjson>
<pzFromFrame>pyWorkPage</pzFromFrame>
<ClientInt>Start</ClientInt>
<pzTransactionId>b8ad38b9ac515d4dbf91a5f3145c707e</pzTransactionId>
<inStandardsMode>true</inStandardsMode>
<UITemplatingStatus>N</UITemplatingStatus>
<pzActionID/>
<AJAXTrackID>1</AJAXTrackID>
<pzActivity>xyTestActivity</pzActivity>
</pagedata>