Service – Rest rule we are using Post method , In the service activity we are capturing all the case data from clipboard pages .From clipboard each page data is mapping to Service each page as per the given JSON format, by using the Message data section, Request body Map to à JSON format. This format we are sending to external system.During this process from clipboard pagelist property is not converting into Array format in the JSON.
Expected JSON code:
“Name”: “Test”,
" TypeOfIceCream ": [
Vanilla,
Strawberry,
Chocolate Chip
],
Actual PEGA behavior:
{
“Name”: “Test”,
“TypeOfIceCream”: [
{
“IceCreamNames”: “Vanilla”,
},
{
“IceCreamNames”: “Strawberry”,
},
{
“IceCreamNames”: “Chocolate Chip”,
}
],
@dileepm4794
TypeOfIceCream property should be a value list instead of page list
TypeOfIceCream (1) :Vanilla
TypeOfIceCream (2) :Strawberry
TypeOfIceCream (3): Chocolate Chip
@VinayKumarL16594575
Thank you for the response.
The source of Pagelist from PEGA is Prompt list, by changing Pagelist to Valuelist the property is not able to fetch the values defined in the prompt list
@dileepm4794
When you say The source of Pagelist from PEGA is Prompt list what does this mean ?
If you set values for TypeOfIceCream value list on response page, pega will automatically convert this value list to the your expected format.
Thanks,
Vinay
@VinayKumarL16594575
Thank you for the response
As you suggested, I have tried Valuelist.
After the changes my results are coming in array with double quotes but results should be without double quotes.
My results are:
“Name”: “Test”,
“TypeOfIceCream”: [ “Vanilla, Strawberry, Chocolate Chip ” ]
Expected behaviour:
“Name”: “Test”,
“TypeOfIceCream”: [ Vanilla, Strawberry, Chocolate Chip ]
Any suggestion to achieve this??
KaranB17
(Karan Bhalla)
August 16, 2023, 5:09am
6
@dileepm4794 If double quotes are removed then it will be an invalid json format. Please check the attachements.
@dileepm4794
I believe you haven’t mapped the value list correctly.
Please set the TypeOfIceCream values like below:
TypeOfIceCream (1) = “Vanilla”
TypeOfIceCream (2) =“Strawberry”
TypeOfIceCream (3) = “Chocolate Chip”
I think currently you mapped the value for TypeOfIceCream like below which is wrong for your expected output.
TypeOfIceCream(1) = “Vanilla, Strawberry, Chocolate Chip ”
Please refer attached screenshot.
Output: {“pyNames”:[ “Vanilla” ,“Strawberry” ,“Chocolate Chip” ] }
Thanks,
Vinay
@VinayKumarL16594575
Hi Vinay
I hope you’re doing well.
**I have ReportList which contains the Name text property and AddressList property.
I am getting the data in the clipboard:
ReportList (1)
Name:ABC
AddressList
AddressList(1).Number: 1
AddressList(2).Number: 2
AddressList(3).Number: 3
ReportList (2)
Name:DEF
AddressList
AddressList(1).Number: 4
AddressList(2).Number: 5
I Have to map the above clipboard mapping to the JSON structure format through data transform (FYI, we are not using JSON data transforms).
My Json expected mapping is below format:
Reports
{
“reportingName”: “ABC” ,
“reportingAddress”: {1,2,3}
}
{
“reportingName”: “DEF” ,
“reportingAddress”: {4,5}
}
Note : reportingAddress is a value list Array
**Can you please suggest what logic can be used to achieve the above JSON.