# Not able to populate array format in JSON from PEGA pagelist.

**URL:** <https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919>\
**Category:** General\
**Tags:** 8-6, system-administration, data-integration\
**Created:** [August 11, 2023, 6:37pm UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919 "2023-08-11T18:37:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dileepm4794](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dileepm4794](https://forums.pega.com/u/dileepm4794)\
**Post date:** [August 11, 2023, 6:37pm UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919/1 "2023-08-11T18:37:21Z")

</div>

**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”,

}

],

---

<div class="post-metadata">

**Author:** ![VinayKumarL16594575](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/vinaykumarl16594575/32/13794_2.png) [@VinayKumarL16594575](https://forums.pega.com/u/VinayKumarL16594575)\
**Post date:** [August 14, 2023, 9:09am UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919/2 "2023-08-14T09:09:58Z")

</div>

@dileepm4794

TypeOfIceCream property should be a value list instead of page list

TypeOfIceCream (1) :Vanilla

TypeOfIceCream (2) :Strawberry

TypeOfIceCream (3): Chocolate Chip

---

<div class="post-metadata">

**Author:** ![dileepm4794](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dileepm4794](https://forums.pega.com/u/dileepm4794)\
**Post date:** [August 14, 2023, 2:06pm UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919/3 "2023-08-14T14:06:57Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![VinayKumarL16594575](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/vinaykumarl16594575/32/13794_2.png) [@VinayKumarL16594575](https://forums.pega.com/u/VinayKumarL16594575)\
**Post date:** [August 15, 2023, 10:02am UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919/4 "2023-08-15T10:02:21Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![dileepm4794](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dileepm4794](https://forums.pega.com/u/dileepm4794)\
**Post date:** [August 16, 2023, 1:50am UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919/5 "2023-08-16T01:50:22Z")

</div>

@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??

---

<div class="post-metadata">

**Author:** ![KaranB17](https://avatars.discourse-cdn.com/v4/letter/k/df788c/32.png) [@KaranB17](https://forums.pega.com/u/KaranB17)\
**Post date:** [August 16, 2023, 5:09am UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919/6 "2023-08-16T05:09:53Z")

</div>

@dileepm4794 If double quotes are removed then it will be an invalid json format. Please check the attachements.

 ![InvalidJson.JPG](https://pega1.discourse-cdn.com/pega/original/2X/f/f693ebf84af62d128d93feb848f472ea7ffe1e72.jpeg)

 ![ValidJson.JPG](https://pega1.discourse-cdn.com/pega/original/2X/9/9c6f428642ac25e0321e0416bec2f6ddc8b9ecb9.jpeg)

---

<div class="post-metadata">

**Author:** ![VinayKumarL16594575](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/vinaykumarl16594575/32/13794_2.png) [@VinayKumarL16594575](https://forums.pega.com/u/VinayKumarL16594575)\
**Post date:** [August 16, 2023, 8:48am UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919/7 "2023-08-16T08:48:19Z")

</div>

@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

 ![Json Parsing 1.PNG](https://pega1.discourse-cdn.com/pega/original/2X/6/677d6ddb3c398a57c4ae6dc06ceadc764bda59b0.png)

---

<div class="post-metadata">

**Author:** ![dileepm4794](https://avatars.discourse-cdn.com/v4/letter/d/6f9a4e/32.png) [@dileepm4794](https://forums.pega.com/u/dileepm4794)\
**Post date:** [March 20, 2024, 7:13pm UTC](https://forums.pega.com/t/not-able-to-populate-array-format-in-json-from-pega-pagelist/4919/8 "2024-03-20T19:13:46Z")

</div>

@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.
