Question

Reg mapping JSON Array List from Rest API Response to Pega Value List Property

The Pega PRPC version used is 8.2.1

We are Calling the REST API using Connect REST from Pega PRPC 8.2.1, in the response we receive the below conditions json array, we have mapped the below JSON Array to a value list as it is only single value elements inside the json array. snippets below,

"conditions":[

"condition text 1",

"condition text 2"

]

When this mapping is done, pega throws an error like below,

WrongModeException conditions(1) was of mode String while com.pega.pegarules.data.internal.clipboard.ClipboardPropertyImpl.getPageValue() was expecting Page mode

The same works when conditions property is created with page list type.

Is it recommended to create conditions property as pagelist for the mapping to be successful or is there an hotfix for this?

***Edited by Moderator Marissa to update platform capability tags****

Correct Answer
November 12, 2019 - 2:50am

Pega Creates a Page List for the below JSON code snippet when using Connect REST Wizard in Version 8.2. So even I have created a page list to store the values of the conditions. The values are stored in pyValue property of the page.

"conditions":[

"condition text 1",

"condition text 2"

]

Comments

Keep up to date on this post and subscribe to comments

Pega
November 4, 2019 - 11:55pm

Hi Dinesh,

What is default response mapper created when the Connect REST is created, by default when you create the rule from the wizard, the response structure is created either in Pega or Valuelist based on what has been referred during creation.

Check once what you had referred as a sample response while creation of the Connector Rule

November 5, 2019 - 5:27am

In 7.3.1 it works, just checked.

Here's my configuration:

1 = Map to JSON

2 = The page property to map to

3 = The page property structure

4 = this is a value list property (Text mode)

This is a data page I use to trigger the connector:

After triggering the data page, here's the raw response from logs:

And here're the parsing results on the data page:

As you can see, all 3 values are properly mapped to Conditions value list.

November 5, 2019 - 5:39am
Response to vaspoz

Thanks for the response vaspoz. I'm not sure if the same would work in Pega 8.2 version. We have tried the same and it didn't work. 

November 5, 2019 - 6:44am
Response to DineshKumarD9112

Well, if you're pretty sure, that it's not a local configuration problem, then you should raise a request to Pega

November 12, 2019 - 2:50am

Pega Creates a Page List for the below JSON code snippet when using Connect REST Wizard in Version 8.2. So even I have created a page list to store the values of the conditions. The values are stored in pyValue property of the page.

"conditions":[

"condition text 1",

"condition text 2"

]