---
schema_version: "1"
id: ba37686be9254363e71e5dc890ac2816bb48a75f516bf34a81db6d982a4f625a
title: DataWeaveResource
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/api_meta/meta_dataweaveresource.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_dataweaveresource.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: f0567ce03cdc1274652e3cb1b4d52de784a0f1af8f74b203cd3402b4d14e1a52
description: Represents the DataWeaveScriptResource class that is generated for all DataWeave scripts. DataWeave scripts can be directly invoked from Apex.
---
# DataWeaveResource

Represents the DataWeaveScriptResource class that is generated for all DataWeave scripts. DataWeave scripts can be directly invoked from Apex.

## Parent Type

This type extends the [MetadataWithContent](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_metadatawithcontent.htm "MetadataWithContent is the base type for all metadata types that contain content, such as documents or email templates. It extends Metadata. You can’t edit this object.") metadata type and inherits its content and fullName fields.

## File Suffix and Directory Location

DataWeaveResource components have the suffix .dwl and are stored in the dw folder.

## Version

DataWeaveResource components are available in API version 58.0 and later.

## Special Access Rules

There are no additional access requirements that are specific to this type.

## Fields

| Field Name | Description |
| --- | --- |
| apiVersion | 
Field Type

double

Description

Required.

The API version for this component.



 |
| isGlobal | 

Field Type

boolean

Description

When set to true, the generated DataWeaveScriptResource class is global.



 |
| isProtected | 

Field Type

boolean

Description

Not used.



 |

## Declarative Metadata Sample Definition

The following is an example of a DataWeaveResource component.

csvToContacts.dwl

%dw 2.0
input records application/csv
output application/apex
---
records map(record) -> {
 FirstName: record.first\_name,
 LastName: record.last\_name,
 Email: record.email
} as Object {class: "Contact"}

csvToContacts.dwl-meta.xml

<?xml version="1.0" encoding="UTF-8"?>
<DataWeaveResource xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion\>58.0</apiVersion\>
    <isGlobal\>true</isGlobal\>
</DataWeaveResource\>

The following is an example package.xml that references the csvToContacts definition.

<?xml version="1.0" encoding="UTF-8"?>
<Package
      xmlns="http://soap.sforce.com/2006/04/metadata">
      <types\>
            <members\>csvToContacts</members\>
            <name\>DataWeaveResource</name\>
      </types\>
      <version\>58.0</version\>
</Package\>

## Wildcard Support in the Manifest File

This metadata type supports the wildcard character \* (asterisk) in the package.xml manifest file. For information about using the manifest file, see [Deploying and Retrieving Metadata with the Zip File](https://developer.salesforce.com/docs/atlas.en-us.264.0.api_meta.meta/api_meta/file_based_zip_file.htm).