---
schema_version: "1"
id: 1a5707f86d2b6ed106ec9af959d32452b74ab9986e72330d22b1f01c4daf6406
title: findDataFormatDescriptorByMime
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.11/dw-runtime-functions-finddataformatdescriptorbymime.md
canonical_url: https://docs.mulesoft.com/dataweave/2.11/dw-runtime-functions-finddataformatdescriptorbymime
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 9fdeb330c104a9e55c8ffee8f2083ff43843c8c42a3326a6e9afb3162320d511
description: MuleSoft Documentation Site
release: "2.11"
latest: false
---
---
product: DataWeave
version: 2.11
---

# findDataFormatDescriptorByMime

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## findDataFormatDescriptorByMime(mime: dw::module::Mime::MimeType): DataFormatDescriptor | Null

Returns the `DataFormatDescriptor` based on the `dw::module::Mime::MimeType` specified or `null` if
there is no `DataFormatDescriptor` for the given `MimeType`.

_Experimental:_ This function is an experimental feature that is subject to change or removal from
future versions of DataWeave.

_Introduced in DataWeave version 2.7.0._

### Parameters

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><p><code>mimeType</code></p></td><td><p><code>dw::module::Mime::MimeType</code></p></td><td><p>The MIME type value to search.</p></td></tr></tbody></table>

### Example

This example searches for a JSON `DataFormatDescriptor` and an unknown `DataFormatDescriptor`.

#### Source

```DataWeave
%dw 2.0
import * from dw::Runtime
output application/json

var jsonDF = findDataFormatDescriptorByMime({'type': "*", subtype: "json", parameters: {}})
var unknownDF = findDataFormatDescriptorByMime({'type': "*", subtype: "*", parameters: {}})

fun simplify(df: DataFormatDescriptor | Null) = df  match {
  case d is DataFormatDescriptor -> { name: d.name, defaultMimeType: d.defaultMimeType }
  case is Null -> { name: "unknown", defaultMimeType: "unknown" }
}
---
{
  json: simplify(jsonDF),
  unknown: simplify(unknownDF)
}
```

#### Output

```Json
{
  "json": {
    "name": "json",
    "defaultMimeType": "application/json"
  },
  "unknown": {
    "name": "unknown",
    "defaultMimeType": "unknown"
  }
}
```
