How to remove keys from a complex array | Community
Skip to main content
tibormolnar
Level 4
October 25, 2025
Question

How to remove keys from a complex array

  • October 25, 2025
  • 1 reply
  • 209 views

If I have an array of collections with key-value pairs, what's the easiest way to transform this array so that only certain keys (and their values) are preserved in the array?

For example, if this is the output of a HTTP request module:

how can I transform this data so that within each collection I have only the value and label keys?

I'd like to store the transformed array in a variable so that I can later "search" within that with the map function.

Thank you!

 

1 reply

AshpektSolutions
Level 2
October 28, 2025

@tibormolnar 

Based on my understanding, you want label & value from collection and create a new simplified array. 

You can achieve this by mapping items into a new array & using map function.

Source : https://experienceleague.adobe.com/en/docs/workfront-fusion/using/create-scenarios/map-data/map-an-array#map-items-into-a-new-array

This will help you define exactly which fields you want to include in your new array structure.

If this helps, please mark this as Correct answer so others can benefit too!