Gopi
Gopi

Reputation: 105

How to convert list hashmap into Array using Dataweave

I have list as below

[{customerId="123"},{customerId="456"},{customerId="786"}]

I want to convert above as Array like below

[123,456,786]

Can you please help on how to achieve using dataweave

Upvotes: 0

Views: 2579

Answers (1)

AnupamBhusari
AnupamBhusari

Reputation: 2415

Following code will return array

%dw 1.0
%output application/java
---
payload.customerId map $ as :number

Please refer dataweave-selectors for more details.

Upvotes: 4

Related Questions