Mapping within Data Prep Tool for productListItems.quantity not working as expected | Community
Skip to main content
Level 2
July 20, 2025
Solved

Mapping within Data Prep Tool for productListItems.quantity not working as expected

  • July 20, 2025
  • 1 reply
  • 269 views

Hi all,

I've run into issues with mapping inside the data prep tool, specifically within productListItems. The solution would need to be able to iterate through an array.

I am experiencing a dataset error where the Quantity is coming back as a string and not a number. I updated the code in my launch script so it would stop happening but am still getting this error about once a day. I tried using the following code within Data Prep Tool using a calculated field but it is still not working. My target field would productListItems[*].quantity but I cannot use that notation inside a calculated field because it does not accept [*].

Mapping Tried

  • to_integer(quantity). 
  • to_integer(productListItems.quantity)

Error message in datasets: #/productListItems/0/quantity: expected type: Number, found: String.

Sample Array:
[
{
"sku": "HGYU_89",
"name": "Wireless Mouse",
"pricetotal": 29.99,
"quantity": 2
},
{
"sku": "ABC_01",
"name": "Mechanical Keyboard",
"pricetotal": 89.95,
"quantity": 1
},
{
"sku": "XYZ_02",
"name": "USB-C Hub",
"pricetotal": 45.50,
"quantity": 3
}
]

Any assistance would be greatly appreciated!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Harveer_SinghGi1

Hi @bryantre ,

In my opinion the best way to transform array fields is either on client side where developers can help you pass the right format or in Adobe Launch which seems you have already done. Data prep cannot transform the array fields as you cannot use them in calculated fields.

I think what you have built in Adobe Launch should be enough, 1-2 instances that you still see might be coming from old cached libraries on some user browsers which should clear out with time.

Cheers!

1 reply

Harveer_SinghGi1
Community Advisor and Adobe Champion
Harveer_SinghGi1Community Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
July 28, 2025

Hi @bryantre ,

In my opinion the best way to transform array fields is either on client side where developers can help you pass the right format or in Adobe Launch which seems you have already done. Data prep cannot transform the array fields as you cannot use them in calculated fields.

I think what you have built in Adobe Launch should be enough, 1-2 instances that you still see might be coming from old cached libraries on some user browsers which should clear out with time.

Cheers!