In Mule 4, you can convert JSON data to PDF by first transforming the JSON into an HTML or other printable format and then generating the PDF using a suitable PDF library or connector.
For simple datasets, DataWeave can be used to format the JSON values into an HTML document, which can then be converted to PDF. If you have a large JSON file or need a more straightforward approach without developing a custom Mule flow, a dedicated tool can be easier.
SysTools JSON to PDF Converter can convert JSON files into PDF format while keeping the data readable and organized, making it useful when the goal is simply to obtain a shareable or printable PDF rather than build a complete conversion workflow in Mule 4.
#MuleSoft Community Posts13 debatiendo
- Actividad reciente
- Fecha de creación
- Recomendado
- Todas las preguntas
- Preguntas con una respuesta aceptada
- Preguntas sin respuesta
- Preguntas sin una respuesta aceptada
My Input will get as below String like:
[{
"ComplteDate in 180 days"
}]
The scenario like I need to filter the data from source based on field called "ComplteDate" using this date field need to fetch data with WhereClause =[ComplteDate]<= dateadd(dd,180,Cast(getdate() as date) )
Example payload in Data source :[
{
"PerformNumber": "C-81022",
"Status": "In Progress",
"ComplteDate": "2028-05-01"
},
{
"PerformNumber": "C-81023",
"Status": "In Progress",
"ComplteDate": "2029-09-01"
},
{
"PerformNumber": "C-81024",
"Status": "In Progress",
"ComplteDate": "2028-05-01"
},
{
"PerformNumber": "C-81024",
"Status": "In Progress",
"ComplteDate": "2029-09-01"
},
{
"PerformNumber": "C-81025",
"Status": "In Progress",
"ComplteDate": "2028-05-01"
},
{
"PerformNumber": "C-81026",
"Status": "In Progress",
"ComplteDate": "2029-09-01"
},
{
"PerformNumber": "C-81026",
"Status": "In Progress",
"ComplteDate": "2025-05-01"
},
{
"PerformNumber": "C-81027",
"Status": "In Progress",
"ComplteDate": "2025-09-01"
},
{
"PerformNumber": "C-81028",
"Status": "In Progress",
"ComplteDate": "2025-05-01"
},
{
"PerformNumber": "C-81029",
"Status": "In Progress",
"ComplteDate": "2025-09-01"
}
]
10 sept, 15:35 Hi Vya,
Here's the DataWeave 2.0 script for this filter (ComplteDate <= today + 180 days):
%dw 2.0
output application/json
var cutoffDate = (now() as Date) + |P180D|
---
payload filter (
(item.ComplteDate as Date {format: "yyyy-MM-dd"}) <= cutoffDate
)
Applied to your sample payload, this returns:
%dw 2.0
output application/json
var cutoffDate = (now() as Date) + |P180D|
---
payload filter (
(item.ComplteDate as Date {format: "yyyy-MM-dd"}) <= cutoffDate
)
Key points on how this works:
1. now() returns the current DateTime. Casting it to Date strips the time portion, so you're comparing pure dates, not datetime with time-of-day noise.
Reference:
https://docs.mulesoft.com/dataweave/latest/dw-core-functions-now2. |P180D| is a Period literal representing 180 days, this is DataWeave's native way of expressing durations (Period type), introduced in DataWeave 2.4.0. Adding it directly to a Date value shifts the date forward by that period.
Reference:
https://docs.mulesoft.com/dataweave/latest/dw-periods-functions-period3. item.ComplteDate as Date {format: "yyyy-MM-dd"}: your ComplteDate field comes in as a String ("2028-05-01"), so it needs an explicit cast to Date with the matching format before it can be compared against another Date value. Comparing a String directly against a Date will not work correctly.
4. filter iterates the array and keeps only elements where the condition evaluates true, standard DataWeave array function, no import needed for filter itself (only the Dates/Periods module functions need explicit import if you use more advanced ones like today() or the dw::core::Dates module functions).
If you'd rather use the more explicit Dates module (cleaner syntax for date-only arithmetic, avoids DateTime timezone quirks entirely):
%dw 2.0
import * from dw::core::Dates
output application/json
var cutoffDate = today() plusDays 180
---
payload filter ((item.ComplteDate as Date {format: "yyyy-MM-dd"}) <= cutoffDate)
Reference:
https://docs.mulesoft.com/dataweave/latest/dw-datesEither version works, the second is arguably more readable for pure date math since it avoids mixing DateTime and Date casting.
How to Skip attribute or key ( eg SSN, password - sensitive )while transforming the object using mapObject
Payload:
[
{
"personal_information": {
"first_name": "Emiliano",
"middle_name": "Romoaldo",
"last_name": "Lesende",
"ssn": "001-08-84382"
},
"login_information": {
"username": "3miliano",
"password": "mypassword1234"
}
},
{
"personal_information": {
"first_name": "Mariano",
"middle_name": "Toribio",
"last_name": "de Achaval",
"ssn": "002-05-34738"
},
"login_information": {
"username": "machaval",
"password": "mypassword4321"
}
}
]
Here I have to remove ssn, password key from.
write now I have personal_information, login_information but i hv more attribute on same level
looking for dynamic way : except personal_information, login_information other attributes doesnt have sensitive information.
I have written below dataweave expression but its giving error. Can someone explain what is the error and solution
MY code:
%dw 2.0
output application/json
// I have to remove sesitive fields like ssn, password from payload
---
payload map (value, key)->{
(value mapObject(obj, objKey, index)->
objKey match {
case str if( objKey as String == "personal_information" ) -> ( obj- "ssn")
case str if( objKey as String == "personal_information" ) -> ( obj- "password")
else -> obj
}
}
13 mar 2023, 21:35 Hi @Vidyasagar Mundhe ,
Check this script:
%dw 2.4
output application/json skipNullOn="everywhere"
var payload = [
{
"personal_information": {
"first_name": "Emiliano",
"middle_name": "Romoaldo",
"last_name": "Lesende",
"ssn": "001-08-84382"
},
"login_information": {
"username": "3miliano",
"password": "mypassword1234"
}
},
{
"personal_information": {
"first_name": "Mariano",
"middle_name": "Toribio",
"last_name": "de Achaval",
"ssn": "002-05-34738"
},
"login_information": {
"username": "machaval",
"password": "mypassword4321"
}
}
]
var sensitiveFields = ['ssn','password'] map upper($)
fun processValue (value,key) = if(typeOf(value)~=Object) removeSensitiveData(value)
else
(if ((sensitiveFields contains upper(key))) null else value)
fun removeSensitiveData(item) = item mapObject (value,key) -> (key): processValue(value,key)
---
payload map removeSensitiveData($)
Here I'm walking first through the array of elements, and per each element I'm doing the mapObject. Then I'm checking in a recursive way if the value is an object or not. Based on that I'm removing the content of the attribute if the key is in the list sensitiveFields. With the skipNullOn directive I'm removing it from the result.
Be aware that it won't remove object in this code, only values.
Hope it helps
Good luck!
Juan Cruz Basso
unble to convert xml to json array in dataweave 2.0
output :
"employees":{
"employee":{
"name" : "abc"
},
"employee":{
"name" : "xyz"
}
}
expected output :
"employees":{
"employee" : [
{ "name" : "abc" },
{ "name" : "xyz" }
]
dataweave script :
%dw 2.0
output application/json
---
payload
11 ene 2019, 17:08 Hi @tejakkk ,
Could you try using next?
%dw 2.0
output application/java
---
{"employees":{
"employee":
(payload.employees.*employee map{
"name":$.name
} )
}
}
I hope the above helps! If you have any doubt do not hesitate to contact me.
Regards,
Arianna Flores
Hello,
I have a question: if I book an exam A using a voucher, but then I have to cancel the exam and would like to book an exam B using that voucher, can I do it? Or can I no longer use the voucher even if I canceled exam A?
Thanks.
27 ago, 6:15 I was looking for a simple way to calculate working hours and time differences without doing the calculation manually. This tool was useful for quickly checking total hours:
It may also be helpful for anyone dealing with work schedules or time-based calculations.
QQ : We are trying to access azure from our mule application which was in IBM Cloud and we are getting the below exception. Any advise on this is truly appreciated. Thank you.
Getting the below exception
org.mule.runtime.core.internal.exception.OnErrorPropagateHandler:
********************************************************************************
Message : An unknown failure occurred : Connection timed out (Connection timed out)
Error type : AZURE-STORAGE:SERVICE_INTERNAL_ERROR
Payload Type : org.mule.runtime.core.internal.streaming.bytes.ManagedCursorStreamProvider
--------------------------------------------------------------------------------
We are using the below connector
https://www.mulesoft.com/exchange/org.mule.modules/azure-storage-connector/
27 ago, 11:17 Hi,
Is this issue got resolved. Kindly let me know the solution as I'm also getting the AZURE-STORAGE:SERVICE_INTERNAL_ERROR.
Thank you in advance.
,
I need to identify all Salesforce Reports (API Name) where a custom Case field is in use. I am not referring to the data in the custom field. I am focused on
Reports
that use the field. I also need the Report of Reports to return the Last Run Date. My goal is to present this to the business to justify why they no longer need the field, if they aren't even reporting on it. If I discover all their reports that have the field have not been run in a long time, that tells me they don't rely on this field anymore. Then I can have a conversation with them about it and provide proof that it is not being relied on.
Hopefully I have worded this well. Does anyone know of a way to accomplish this? I've found in the Developer Guide an object called Report but I don't see that it allows to filter by Fields on the reports. Thanks in advance.
#Reports & Dashboards #Dataloader.io10 ago, 15:52 That’s a useful approach, especially when you need to track field dependencies across a large number of reports. Pulling the report metadata and then searching for the field reference should make it much easier to identify hidden or overlooked dependencies. The MetadataTooling API route also seems more reliable than checking reports manually one by one.
I am suddenly experiencing multiple errors when trying to use Dataloader.io. It takes 20 or 30 attempts to get something uploaded. I tried to open a case with them, but every time I try to access support it forces a login and sends me back to the home page, so they closed the case thinking I was not responding. Yes, I have tried clearing cache and using an incognito window and different browser. Anyone else experiencing problems with Dataloader.io? Is there any way to get support via Salesforce?
30 jul, 16:34 Hi Stephanie,
A few things that might help, since
dataloader.io is actually a separate product from Salesforce's own Data Loader (it's a third-party SaaS tool), so Salesforce support won't be able to assist with it directly — you'll need to go through dataloader.io's own channels.
1. Why you're getting bounced back on Support
The
dataloader.ioSupport/Case portal is only available to Professional or Enterprise paid subscribers. If you're on the Free tier, submitting a case there will redirect you, since free users are directed to the Community Forums instead of direct support tickets. That's likely why you keep getting sent back to the home page.
2. Alternative way to reach them
If the in-app Help Center login loop won't let you submit a ticket, you can email them directly instead:
info@dataloader.ioThis bypasses the portal login issue entirely.
3. On the login-loop / repeated failures
Since you've already cleared cache, tried incognito, and different browsers, a few other things worth checking with your Salesforce Admin (if you're not the Admin yourself):
- Setup > Connected Apps OAuth Usage — check if
dataloader.ioshows a "Blocked" status with an "Unblock" button next to it. If so, it needs to be unblocked there.
- Check if your Profile has "Enforce Canvas UI" enabled under Settings > User Profile — if so, you may only be able to log in through the embedded canvas app inside Salesforce, not the standalone
dataloader.iowebsite.
- Confirm there are no IP restrictions on your Profile blocking
dataloader.io's IP ranges — if there are, you'll need to allowlist dataloader.io's published IP addresses.
- Confirm "API Enabled" is checked on your Profile under Administrative Permissions.
4. If uploads keep failing (not just login)
Since you mentioned it's taking 20-30 attempts to get an upload through, and not just login issues, this could also be an intermittent platform issue on
dataloader.io's end rather than something on your Salesforce side. Worth checking dataloader.io's status/community forums to see if others are reporting the same thing around the same dates — that'll tell you if it's a known outage versus something specific to your org's setup.
Given the support portal limitation, the email route (
info@dataloader.io) is probably your fastest path to a real human at this point.
Happy Tuesday - There are about 60 events with existing contacts (whoid) and I need to add just one contact to the events.
Created a test event and tried via the Data Loader - Event Relation - Insert - mapping is below...
However, contact is not appearing in the event - What I am missing?
#Data Management #Dataloader.io #Sales Cloud
7 nov 2025, 5:16 Greetings, @Nate Schaufler
From the outside looking in, it looks like you have all the required fields. Can you do the following to confirm that you are not missing anything:
1. Export one working EventRelation record (from an event that already has a contact)
I suspect you might have to use TRUE & FALSE instead of 1 & 0.
Be well-
Katende
Use Data Loader → Export → EventRelation
Export fields: EventId, RelationId, IsInvitee, IsParent
This lets you see the correct structure and flag values.
I would like to mass upload a file of photos. I have the record Ids. I am following the steps in this article but it doesn't mention anything like Content Version ID yet it is a required field on the Content Version object.
11 mar, 17:32 Please refer to the below link -
https://www.youtube.com/watch?v=-2OS6QylZQ0
If you are targetting to upload files under any specific record - mention the same under FirstPublishLocationId.
If you want the files to be uploaded under the Salesforce Files - give your user Id under FirstPublishLocationId.
You can try with workbench by omitting the ContentDocumentId field - works this way too