# 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/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://2668731230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fknvt0jlDBXmk91mWaWXB%2Fuploads%2FgMkhzJTY3potaqdsIKEk%2FAssetQuery_01.png?alt=media&#x26;token=4a78f6bd-2425-4229-ae46-ac169d62fcc3" alt=""><figcaption><p>Loading Textures automatically into a Template Material</p></figcaption></figure>

<figure><img src="https://2668731230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fknvt0jlDBXmk91mWaWXB%2Fuploads%2Fmlf6VgL5UeHHyCc73SlU%2FAssetQuery_02.gif?alt=media&#x26;token=be34533c-7d0c-4502-866c-93441c92e693" 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**.
