---
schema_version: "1"
id: c474f9697517e09175be565c7ecde22d5a5f2816b8636970a54d01a6a75702bc
title: "DataSense: Discover Message Metadata as You Design Applications"
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/studio/datasense-concept.md
canonical_url: https://docs.mulesoft.com/studio/datasense-concept
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 8dfc3811db34d115ae1f4d5492f59a52041f16437cef4c67a9eab1fd2a1489e1
description: MuleSoft Documentation Site
latest: true
---
---
product: Studio
keywords: anypoint studio, datasense, metadata, meta data, query metadata, dsql, data sense query language
---

# DataSense: Discover Message Metadata as You Design Applications

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

DataSense is a feature of Anypoint Studio that uses Mule event metadata to help you design
applications. Rather than forcing you to manually discover this metadata, Anypoint Studio
automatically acquires it so that you can map or use this data in your application.

## Understand How DataSense Uses Mule Event Metadata

You must understand how your components use metadata in a flow to ensure data reliability in your
Mule application. This understanding enables you to detect errors early during project design.
Additionally, it helps you identify when a component needs metadata that isn’t exposed to it within
its scope, thus promoting data reusability.

## Use Datasense to Map Data

Consider a flow in which you include an Anypoint Connector preceded or followed by a Transform
Message component. The Mule runtime engine uses the working connection to the resource to retrieve
and supply DataWeave metadata about the payload and properties. This feature saves you the effort of
manually inspecting Mule event structure.

For example, imagine that you must connect your organization’s Salesforce account to Slack to notify
your team about a new opportunity. To do this, you can drop both Salesforce and Slack connectors on
your Studio canvas and configure them to connect to your organization’s accounts. Then, you can drop
a Transform Message component between the connectors. Mule automatically captures the data type and
structure information from each provider and prescribes the input and output for your data mapping.
With this prescription in place, you can configure the mapping, populating the DataWeave code.

![A diagram depicting a workflow for transforming an object into JSON](/mulesoft/current/en-us/studio/_images/datasense-perceptive-flow-design-concept-cf42d.png)

## Use Datasense for Autocomplete

Imagine that you’re obtaining status update data from the Slack connector. You want to log the
message you’re sending to Slack, but you aren’t familiar with the property names used by this
connector. Instead of referring to Slack documentation, you can insert a Logger message processor
after the Slack connector and begin to type in it, which activates autocomplete. For example, if you
type `#[payload.` and press `Ctrl+Spacebar`, you get a list of all the properties and methods
associated with that payload. In the list, you also get the properties returned by your request to
the Slack connector.

![The DataSense autocomplete feature highlighted in the payload](/mulesoft/current/en-us/studio/_images/payload-autocomplete.png)

## When to Manually Define Metadata

You can manually define the metadata that all the components of a Mule application expose. You must
do this if required (for example, for a metadata type that you defined). Or you must define metadata
manually if it’s most cohesive to an annotated value (for example, when a component uses or expects
a specific metadata type).

When working with flows and subflows, you must declare their metadata contract to specify the shape
of the event you require and the shape of the event you return to the caller. On the contrary, do
not define metadata when using the Transform Message component because DataWeave defines the
contract between the producer and the consumer of data. In this situation, if you explicitly declare
a metadata type, you mask the actual metadata type of the data coming from your Transform Message
component.

## See Also

- [DataSense Explorer](https://docs.mulesoft.com/studio/datasense-explorer)
