# Asset Query

Asset Queries are available for **Set Attribute Value** and **Set Property** actions. With these actions we can perform a search through the current org's Asset Library, for specific assets that have a given set of metadata key-value pairs.

This functionality enables us to build automation with [Template Assets](https://app.gitbook.com/s/8N1IA5a0lqRClKT5eQQ7/learn/workflows/template-assets), so that we can handle large sets of configurable 3D models and materials at scale. These setups typically work in conjunction with [Metadata Value Queries](https://community.threekit.com/platform-documentation/catalog-2.0-docs/project-data/logic/queries/metadata-value-query).

{% hint style="info" %}
The query will always return ONLY ONE asset - the last updated asset that matches the metadata provided, and of the type required by the action.

For example: a **Set Attribute Value** action on an attribute of type a**sset-texture** will only search for texture assets.
{% endhint %}

Let's take a look at an example of a [Template Material](https://app.gitbook.com/s/8N1IA5a0lqRClKT5eQQ7/learn/workflows/template-assets#advanced-setup), where we are trying to populate three material properties with custom maps for the Cotton Red material option.&#x20;

In this scenario, the catalog item has two metadata fields on it - **Name** and **Family**.&#x20;

The texture assets also have the same metadata fields on them, generated perhaps using the [Apply Metadata Pattern tool](https://app.gitbook.com/s/8N1IA5a0lqRClKT5eQQ7/tools/general-apps/apply-metadata-pattern).

We can then use the **Asset Query** option for the **Set Property** action inside the Template Material, in order to find the three texture assets and assign them automatically.

<figure><img src="https://content.gitbook.com/content/efQOUWnh8WUpteoAKY9N/blobs/h0bDL3fl2apzwsmtuAU5/AssetQuery_01.png" alt=""><figcaption><p>Loading Textures automatically into a Template Material</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/efQOUWnh8WUpteoAKY9N/blobs/90uYlBMszCK56m7NflFi/AssetQuery_02.gif" alt=""><figcaption><p>Using an Asset Query with the Set Property action</p></figcaption></figure>

{% hint style="info" %}
Take note that the Asset Query is currently labelled **Metadata Query** in the ThreeKit UI
{% endhint %}

The usage of the Asset Query with a **Set Attribute Value** action is exactly the same as shown above. The option is only available on attributes of type **asset**.
