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

# 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"
  }
}
```
