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

Modify Existing Json key : Mule

My Input { "Root": { "order": [ { "locale": "en-US", "orderItems": [ { "product": { "partNumber": "23853864" }, "itemSpecifics": { "options": { …
0
votes
1 answer

How to generate dynamic XML Response in Mule4?

In Mule4, I need to convert json sample data in to dynamic XML format, I have tried with dataweave(2.0) field mapping, getting null values. Does anyone can help me on this?
Saikumar R
  • 9
  • 1
  • 3
0
votes
3 answers

How can I do Null and empty check of arraylist using dw() function in mule?

I tried the following way, [dw('sizeOf payload.data.accts')>0] but hthis would just check if arraylist is empty or not .So i need a help to how do I null check on "accts" arraylist using dw() function. I want both null and empty check in dw()…
Shilpa
  • 101
  • 14
0
votes
2 answers

Mule Dataweave - Converting XML to JSON List with Multiple Object types

I have to convert a XML payload to JSON. The challenge here is the order of XML should not be changed while we convert it into JSON list of multiple type of objects ( Single JSON list has multiple object types).
0
votes
1 answer

Mulesoft dataweave: How to convert xlsx file to JSON by including headers?

I am trying convert xlsx to json with dataweave. JSON output is getting generated without headers from the xlsx file. My current code is skipping fisrt row of an excel file. I also need to include firstrow from the input file to output JSON. Below…
Rahul Karankal
  • 103
  • 2
  • 13
0
votes
1 answer

Mapping in Dataweave

I have to do XML to JSON mapping in dataweave. The request XML is: Test
0
votes
1 answer

string to date conversion using dataweave

Input String: 201801 Output String format: 01.2018 I tried using following but it's not working, I also looked up for string to date convesrion/coercion table in "Type Coercion Table"…
N Singh
  • 1
  • 4
0
votes
1 answer

Lookup in Dataweave Mule

I am doing a lookup in dataweave lookup("myflow",$) I am passing entire xml to the flow called. The data received in the flow is of type 'java.util.LinkedHashMap'. I am trying to put a ForEach processor and specify the xpath3 in collection.…
0
votes
2 answers

Mule 3 to Mule 4 error handling queries for error types and http status

I am migrating an error handling file from Mule 3 to Mule 4 using Anypoint Studio 7. My queries are: How would I do I now do this check as I cannot see the same information in the exception message?…
user3165854
  • 1,505
  • 8
  • 48
  • 100
0
votes
2 answers

Dataweave JSON filter

I am trying to select data from a JSON request based on one of the field [ { "Field1": "data1", "Field2": "set1", "Field3": "reset1" }, { "Field1": "data2", "Field2": "set2", "Field3":…
0
votes
1 answer

Dynamic SELECT query which decides whether to use the WHERE clause in Mule 4

I am using Mule 4 and Anypoint 7 and want to setup the database connector to SELECT all customers from my SQL server database table but if the customerName query parameter is populated in the request then I want to add the WHERE clause to only…
user3165854
  • 1,505
  • 8
  • 48
  • 100
0
votes
1 answer

Conditional expression is not working in Mule 4

I have this expression when setting the value of a variable in Mule: #[(message.inboundProperties['message-id'] != null) ? message.inboundProperties['message-id'] : java.util.UUID.randomUUID().toString().replace('-', '')] Basically, if the message…
user3165854
  • 1,505
  • 8
  • 48
  • 100
0
votes
2 answers

DataWeave Mule : Extract from String data after particular character

I have a requirement to extract data from a string after the occurence of '@'. Example abc@123456 should result in 123456. I am doing htis in DataWeave Mule. Kindly suggest
0
votes
2 answers

Many to one JSON to JSON transformation

I need to transform a set of incoming jsons as below to a common structure at the output. The structure of the incoming jsons are as below Input JSON 1 { "JR_ID": "1", "JR_Data": "some text" } Input JSON 2 { "TA_ID": "1", "TA_Data":…
user1356042
  • 395
  • 2
  • 6
  • 23
0
votes
2 answers

Get Data Value from JSON in Mule

I have following response from a API call and now trying to get a value in a variable. [{"Name":"My name","Address":"add1","Location":"NY"}] Tried all following methods but all are returning null or error.
ray
  • 4,210
  • 8
  • 35
  • 46
1 2 3
99
100