Questions tagged [dataweave]

The DataWeave Language is a powerful template engine that allows you to transform data to and from any kind of format (XML, CSV, JSON, Pojos, Maps, etc).

DataWeave is the MuleSoft expression language for accessing and transforming data that travels through a Mule app. DataWeave is tightly integrated with the Mule runtime engine, which runs the scripts and expressions in your Mule app.

DataWeave scripts act on data in the Mule event. Most commonly, you use it to access and transform data in the message payload. For example, after a component in your app retrieves data from one system, you can use DataWeave to modify and output selected fields in that data to a new data format, then use another component in your app to pass on that data to another system.

Full Reference

https://docs.mulesoft.com/mule-user-guide/v/3.7/dataweave-reference-documentation

https://docs.mulesoft.com/mule-runtime/4.2/dataweave

1845 questions
0
votes
1 answer

Need help in Dataweave Transformation

I have the oracle database table CASH which contains below columns: REGISTER DATE CASE BAG TYPE 1234 24-SEP-18 1123 112 A 1234 24-SEP-18 1124 113 S 1234 24-SEP-18 1123 116 S 1234 24-SEP-18 1124 117 A 7895 …
user3368821
  • 79
  • 2
  • 9
0
votes
2 answers

Mule Dataweave: Cannot coerce a :string to a :localdatetime

Guys getting this error when trying to convert to datetime: Exception while executing: utcTime: (payload as :localdatetime {format: "yyyy-MM-dd'T'HH:mm:ssZ" } >> "UTC") ^ Cannot coerce a :string to a :localdatetime, caused by…
ray
  • 4,210
  • 8
  • 35
  • 46
0
votes
1 answer

Mule transform message move out list of objects from array to objects

Mule Transform Message: %dw 1.0 %function removeEmptyInArray(arr) arr map ( (removeEmptyInArray($) when $ is :array otherwise (removeEmptyInObject($) when $ is :object otherwise $ when ($ != null and (sizeOf $) > 0) otherwise null)) )…
0
votes
1 answer

Add BOM in the beginning of a String

I have exposed a GET in an API which returns an application/csv back to the caller. NB: the resulting application/csv is just a string. The caller wants the result to include a BOM. This is how I set the contents of the returned application/csv…
Stanislav Ivanov
  • 425
  • 2
  • 7
  • 19
0
votes
1 answer

mule filter logic processing in dataweave

I have a Json payload i.e. { "Numbers": [ 0 ], "title": "string", "Ids": [ 0, 1, 2 ], "group": 0 } and I am hitting a http call to get collection of records for all customers present in DB i.e. { …
shruti
  • 1
0
votes
2 answers

Mule 3.9 Dataweave droping .00 from integer

Below is my sample code
0
votes
2 answers

DataWeave vs Java Performance

I have requirement to iterate over close to million records. The current code was written in Dataweave with filter and ordering logic. However, I'm seeing a performance issue. I was thinking of converting this DataWeave logic to Java using the Java…
ssan
  • 190
  • 1
  • 4
  • 14
0
votes
0 answers

Aggregate two json payloads into one based on filter

i am trying to aggregate two json payloads into one. below json is stored in payload, { "clients":[ { "status":"IN", "clientSoftDeleteIndicator":"N", "roles":[ { …
Praveen
  • 81
  • 1
  • 3
0
votes
1 answer

Transform string array to csv mulesoft 4.1.2

I have Array of Strings, want to convert it into a csv output in mule 4.1.2. Sample input payload is as below - [ "{\n "id": 123,\n "name": "ABC",\n "communication": "email"\n}", "{\n "id": 123,\n "name": "ABC",\n "communication": "paper"\n}" ] I…
0
votes
1 answer

Issues in merging the xml response and json response in Dataweave

I have the below xml response from one of the soap service:
user3368821
  • 79
  • 2
  • 9
0
votes
1 answer

how to avoid null in json payload output in mulesoft dataweave transform

My output : { "EmployeePositions": { "EmployeeID": "05383803", **"EmployeeName": null,** "Positions": [ { "PositionID": null, …
Deep Sharma
  • 21
  • 1
  • 4
0
votes
1 answer

How to do database insert in mule with bulk mode on for XML input

I have input XML as payload and i want to insert the XML values into database columns using bulk mode on. Mule documentation shows bulk insert can be done only with collections. If it can be done by implementing collections, How can we convert xml…
Venkat
  • 3
  • 2
0
votes
1 answer

Add Extra object inside loop in Mule Dataweave

How to add additional object inside array in dataweave. Please find the input and expected response. I stored the below input in flowVars Input: { "calculate": [{ "rate": 10.4500, "margin": 0.000, "amount": 1000 }] } If the…
star
  • 1,493
  • 1
  • 28
  • 61
0
votes
0 answers

filter mule esb json payload based on request param

I want to filter my json data based on my request. so if my request is like /user it gives me the full json data as result and if i give /user?bikes it filters me the result with json result with bike data and if i use /user?cars it filters me json…
user3428616
  • 65
  • 4
  • 14
0
votes
1 answer

How to debug a MAP function in Dataweave?

I am receiving the below json from the source: { "totalRows": 2, "startRow": 1, "endRow": 2, "hasNextPage": false, "searchResults": { "603": { "dDocOwner": "sysadmin", "dIndexedID":…
user3368821
  • 79
  • 2
  • 9
1 2 3
99
100