Newer Version Available
Examples of DataWeave in Apex
Here are code samples that demonstrate DataWeave in Apex.
To use DataWeave in Apex, follow these instructions with associated examples.
- Create a DataWeave script source file. For example: csvToContacts.dwl.
- Create the associated metadata file.
For example: csvToContacts.dwl-meta.xml.
- Push the source to the scratch org using Salesforce CLI version v7.151.9 or higher. See Salesforce CLI Release Notes.
- Invoke the DataWeave script from Apex and check the results from anonymous
Apex.This example invokes the csvToContacts.dwl script.