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).

1 vote
1 answer
30 views

How to compare and merge two JSON objects using Dataweave 2.0

I have a requirement where I need to compare 2 input json objects - obj1 and obj2. Both inputs can have same keys as well as additional key. In case of same keys in both inputs, the values should be ...
0 votes
1 answer
26 views

Dataweave 1.0 ( Mule 3 ) contains not returning expected results while checking payload

So I will receive a post request with a JSON payload. I need to check if the payload contains the keyword Moscow anywhere in the payload ( not a specific attribute or field ) Sample payload : { &...
0 votes
3 answers
29 views

Compare the inputs and get the response?

Input 01: { "labelItems": [{ "label": "manager", "role": "MA" }, { "label": "Developer", &...
0 votes
1 answer
25 views

Please help the date formating in dataweave2.0

Please help me transforming the date-format from "Mon, 26 Sep 2022 14:51:04 +0000" to this format "2022-09-26" Thanks
  • 37
-1 votes
1 answer
48 views

How to get total object value when we filter child object

I am new for mulesfot and I want to filter below payload total object when characters[].data[] array "name": "priority" and "value": 1 Can some one help me please?. json ...
  • 3,970
0 votes
1 answer
56 views

Comparing two json objects and delete null values from the second json object

I want to compare 2 objects and merge them with patch json data. Comparing payload and patch and remove fields from payload if the values are null in patch object. Input: { "firstname":&...
0 votes
1 answer
25 views

Why is there no keyword return in Dataweave

Why is there no keyword "return" in Dataweave functions? Has it something to do with functional programming constructs?
  • 43
1 vote
3 answers
56 views

dataweave transformation

I have an input of the following payload for a POST method: { "order": { "Column_X": "X", "Column_Y": "Y", "Column_Z": "Z&...
0 votes
1 answer
38 views

DataWeave populate field based on self lookup in payload

I have a use case where we're looking to generate a flat-file based off HRIS data. We retrieve one payload of employee data to include manager The use case is to populate an isManager field if any ...
  • 67
0 votes
1 answer
31 views

How to groupBy two field in dataweave 2.0?

I'm looking for an output similar to this one below where i want to groupBy costomer and orderid. Input: [ { "item": 621, "orderid": "ON22", &...
0 votes
1 answer
30 views

Change a date string format in DataWeave 2

I want to format the date that is stored in variable called "value" %dw 2.0 output application/json var value = "202206" --- { "date": value as String {format: "...
  • 77
1 vote
1 answer
33 views

Access embedded XML attribute using Dataweave

I have this incoming payload <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1....
1 vote
1 answer
18 views

Transform key/pair into in an Object - Mule 4

I want to transform the below input into the given output. My requirement is to convert the key/value pairs into the Objects having key and value as individual elements in an object. Input: { &...
0 votes
1 answer
19 views

How can I migrate this expression code into mule 4

I am migrating mule 3 code to mule 4 and this is the code in Expression component .How can I migrate this into mule 4. { if(vars.deletesVar != null) { vars.combinedArray.addAll(vars.deletesVar); } if(...
2 votes
1 answer
54 views

Why the "default" keyword acts like "try + catch / orElse" in some cases

I recently noticed an interesting behavior from the default keyword. It acts like try-catch or try-orElse in some situation. For example, if you try to execute the following script: %dw 2.0 output ...

15 30 50 per page
1
2 3 4 5
109