No fx button on an ACB field? Set a dynamic value in the XML
A field in Anypoint Code Builder has no fx button? Set the dynamic value in the flow XML with a #[] expression, and read properties with Mule::p() instead of ${}.
Jul 24, 2026
51 ProstDev posts tagged DataWeave — tutorials, guides, and write-ups on DataWeave.
A field in Anypoint Code Builder has no fx button? Set the dynamic value in the flow XML with a #[] expression, and read properties with Mule::p() instead of ${}.
Jul 24, 2026
Round 2 of AI Showdown: MuleSoft Edition. I gave Claude, CurieTech AI, and MuleSoft Vibes the same prompt — build a 3-layer API-led network for Customers + Orders — and scored the results on rigor, completeness, and versions.
Kicking off AI Showdown: MuleSoft Edition (2026) by pitting Claude Code against CurieTech AI on Advent of Code 2025 — same inputs, benchmarked in the DataWeave Playground. Who writes cleaner, faster MuleSoft transformations?
May 28, 2026
Learn how to connect MySQL in Docker to your MuleSoft project in Anypoint Code Builder using VS Code. Build dynamic queries with DataWeave.
Jul 28, 2025
A subtle DataWeave gotcha: when you read keys from an object, you don't always get an Array<String> — you may get an Array<String | Key>, and that breaks equality checks. Here's why, and how to fix it.
In this post, we'll learn how to use the update operator along with the upsert and conditional options. We'll also learn different ways of handling null values for our fields.
I was working on some code that was using both map and filter together and I started thinking if there was a better way to refactor this code to make it more performant.
In this post, I am going to show you how to scaffold your flows in Anypoint Studio from a published API specification.
Nov 29, 2023
Every October we create this series of 31 videos ranging from various tech topics. This year they're MuleSoft-related! Don't miss them.
Oct 3, 2023
Learn how to clean an XML or HTML code snippet to publish in a WordPress article with these DataWeave scripts.
Create a DataWeave script to sum all the digits from the input payload until there's only one digit left.
We are delighted to announce an exciting update to our blog's article submission process!
Create a DataWeave script that will update all the values to uppercase, except the ones in which the field equals thisname.
Create a tail-recursive function to get the factorial of each positive number from the payload.
Reverse the order of the words in the given phrases. However, the punctuation signs stay in the same place.
Move the disks, one disk at a time, from tower A to tower C following the Tower of Hanoi puzzle rules.
Review each of the input phrases and find those that are palindromes. Then, retrieve the character count and sum the total characters.
Create a script to keep your score on a series of Rock Paper Scissors games. 0 if you lose, 3 if it's a draw, and 6 if you win.
In this post, I'm going to guide you through all the steps to generate your own MuleSoft starter project in GitHub to play Battlesnake.
Create a DataWeave script to add all the numbers separated by a paragraph. Then, retrieve the highest number.
In this post, I'll go through some of the main differences between these two operators so you decide which one to use in your scripts!
Learn how to create shareable links from a GitHub repository to open directly in the online DataWeave Playground.
The other day I was reading some StackOverflow DataWeave questions and I got to this very interesting thread.
If you will be working on bigger payloads or simply want to work locally, it's recommended to use Visual Studio Code.
Jan 17, 2023
Security implementations have been revolutionary through OAuth 2.0, OpenID Connect, SAML, etc. OAuth 2.0 and OpenID connect mostly use JWT as a token format. Here's how to create a JWT token using Java and DataWeave.
The DataWeave Language is a simple, powerful tool used to query and transform data inside of Mule. You can also use it to solve an algorithmic problem. Invert a Binary Tree is a popular Coding Question to test your coding skills. Let's try to solve this with DataWeave.
Please take care of the following guidelines before submitting your application to contribute.
In this post, I would like to demonstrate in a few steps how we can make a sync job that allows us to describe a Salesforce instance and use a few objects to create a full schema of those objects (tables) into a Google Big Query Dataset. Then with the schema created we should be able to push some data into BigQuery from Salesforce and see it in our Google Cloud Console project.
Mar 1, 2022
Here are 3 examples where you can see how to check if a key in the input JSON payload is present or not.
Are you already using the newest version of Anypoint Studio? Let me guide you through the coolest features it has. Studio includes 3 new features that you will enjoy: Support for Mule Runtime 4.4, DataWeave 2.4, and the new "Referenced by" function.
Dec 14, 2021
We know that in DataWeave the types can be coerced from one type to another. For that we use the as operator. There is a property called mode that we can use when we are parsing date and time values. The mode parameter has three different valid values: SMART, STRICT, and LENIENT. The default mode when you are parsing dates is SMART.
The main objective of this post is to show how we can implement a field level encryption for a JSON payload in MuleSoft using DataWeave, using the Crypto module and the toBase64 function.
I needed to get a person's age. I started using "daysBetween" but this was a wrong way. In this post, I'll show you how to use the "between" function from the Periods module to retrieve the number of years, months, or days between two dates.
On one of my assignments, I was presented with a rather peculiar demand: to write the records belonging to a unique identifier in a variable. The catch was, we do not know how many such unique identifiers are going to come in a particular batch. The flow will read an excel file and, based on the query string, we'll segregate the records -using a foreach component- and send an email with the final payload.
Jun 8, 2021
It took me some time to find and fully understand how to use these hacks. Trust me; they're truly worth it: the DataWeave Playground, the dw output, the log function, the do statement, and assigning types to variables and functions (with Function Overloading when needed).
There are different ways to import a module in DataWeave for functions that aren't part of the core: import the module directly, import all functions from a module, or import one or more specific functions from a module.
I had this use-case where I had to make sure all the values inside an array were not empty. Empty string or array, null value. In this series of posts, I explain 6 different approaches to achieve almost the same output using DataWeave. Part 4: Using the Arrays Module, Pattern Matching, and Function Overloading.
I had this use-case where I had to make sure all the values inside an array were not empty. Empty string or array, null value. In this series of posts, I explain 6 different approaches to achieve (almost) the same output using different DataWeave functions/operators. Part 3: Using isEmpty and filter.
I had this use-case where I had to make sure all the values inside an array were not empty. Empty string or array, null value. In this series of posts, I explain 6 different approaches to achieve (almost) the same output using different DataWeave functions/operators. Part 2: Using sizeOf, filter, isEmpty, and default.
I had this use-case where I had to make sure all the values inside an array were not empty. Empty string or array, null value. In this series of posts, I explain 6 different approaches to achieve (almost) the same output using different DataWeave functions/operators. Part 1: Using sizeOf, groupBy, isEmpty, and default.
One of the most used actions when we work with Salesforce integrations is the use of query. But there's one action we don't use very often: the Salesforce Object Search Language (SOSL). In this post we walk through a Mule 4 application that uses SOSL to validate Contacts and Leads and decide whether to update or create records.
Jan 26, 2021
A compilation of all the core functions that can be used in DataWeave 2.0 according to MuleSoft's official documentation, separated by input and output, with a link to each function's official documentation page.
How to process n number of pages from a backend API and return the combined response back to the calling client, demonstrated with the GitHub REST API and asynchronous processing.
How to convert a Flat File into JSON, CSV, or XML using DataWeave 2.0, with Anypoint Studio 7.4 and Mule Runtime 4.2.2 — from creating the copybook to the final transformation.
NetSuite is a SaaS-based ERP which allows companies to manage important business using a single tool. MuleSoft provides a NetSuite connector, which enables to automate the business process and synchronize the data between NetSuite and third-party tools.
How to implement Internet of Things (IoT) with MuleSoft: a use case that senses temperature with a Raspberry PI, sends it via Twilio, and blinks a green or red LED depending on the result.
Aug 20, 2020
Mule 4 has a Cryptography module which includes PGP, XML, and JCE. In this article, we will see the PGP technique — a cryptographic way that allows secure communication between two entities using public and private keys.
Aug 18, 2020
You may already know about the DataWeave (DW) Playground that can be used for both versions of DW: 1.0 and 2.0. I will explain how to get this Docker Image running on your laptop (even if you don't know how to use Docker).
Are you familiar with the fromBase64 or the toBase64 functions from DataWeave 2.0? What about the getUrlEncoder or the getEncoder functions from Java? Do you know the differences between the "basic" Base 64 encoding and the "URL and Filename safe" Base 64 encoding? Maybe you're here because you keep getting this error.
Some days ago, I started using this great functionality in DataWeave (DW) 2.0 - Mule 4, and I faced some challenges while creating the code. I'll explain what a custom module is, why you would want to use it, some examples on how you can use it, and finally, how to load properties into this module.
What is object concatenation and how to use it in Mule 4 - DataWeave (DW) 2.0. Similar to concat or + functions in other languages, in DW you can use ++ (plus plus), using {( )} and {([ ])} parentheses object destructors with or without arrays. Learn more about MuleSoft here!
Browse all topics in the tag directory or head back to the blog.