Data Format Manipulation in DataWeave 2.0 (Mule 4) — Using Coercing, Custom Data Types, Functions, and Flows

Photo by Mae Mu on Unsplash

Coercing

Any, Array, Binary, Boolean, CData, Comparable, Date and Time, Dictionary, Enum, Iterator, Key, Namespace, Nothing, Null, Number, Object, Range, Regex, SimpleType, String, TryResult, Type, Uri
price: payload.price as Number
price: $.price as Number {class:”java.lang.Double”}
price as Number as String {format: “###.00”}
someDate as DateTime {format: “yyyyMMddHHmm”}

Custom Data-Type

Functions

#[contains(payload, max)]#[payload contains “max”]

Flow

Keep it simple! stay happy!