Mutltifield to array in AEM Component
Hi Team
I have created a component where I have two multifield properties, and I want to convert the multifield and array format.
"items": {"jcr:primaryType": "nt:unstructured","item0": {"jcr:primaryType": "nt:unstructured","text": "Same as Permanent address","value": "same as permanent address","selected": "false"},"item1": {"jcr:primaryType": "nt:unstructured","text": "Others","value": "others","selected": "false"}},"mapping": {"jcr:primaryType": "nt:unstructured","item0": {"jcr:primaryType": "nt:unstructured","destination": "two","source": "one"},"item1": {"jcr:primaryType": "nt:unstructured","destination": "four","source": "three"},"item2": {"jcr:primaryType": "nt:unstructured","destination": "six","source": "five"}}
Here I have items and mapping multifields.
I would like to have structure like source: ["one","three","five"] and destination: ["two","four","six"]
Could anyone please help on this.
Is it possible to achieve it using htl or js.
Thanks and Regards
Prashanthi