> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uselayers.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Collection sources

> Define reusable product conditions in Layers and publish them for use in native Shopify collections.

Collection sources define **which products belong** in a Shopify collection. Build conditions in Layers, preview the matching products, then publish the source so you can use it in Shopify.

A source is reusable across collections. Updating a published source updates its conditions in Shopify without recreating it.

> [!NOTE]
>
> Collection sources control membership, not product order. Use [sort orders](https://docs.uselayers.com/platform/sorting.md) and [merchandising rules](https://docs.uselayers.com/platform/merchandising.md) to control how the products in a collection appear.

## Before you start

* Connect your Shopify store to Layers and sync the product data you want to use.
* You need permission to view merchandising rules to see collection sources, and permission to edit merchandising rules to create, change, publish, or delete them.
* If you want to use a custom attribute or metric in a condition, configure it in Layers first. The field picker shows the supported fields for your store.

## Create a source

1. Open **Merchandise > Collection Sources** in Layers.
2. Click **Create Source** and give your source a descriptive name, such as "In-stock sale products".
3. In **Conditions**, choose a product field, a comparison, and a value. Add more conditions or groups to combine requirements or exclude products.
4. Review **Preview Results** to see the member count and a sample of matching products. The preview updates as you change valid conditions.
5. Click **Save Draft** to keep working without publishing, or **Publish** to make the source available in Shopify.

Complete each condition before saving. An empty group, missing value, or unsupported comparison prevents saving until you correct it.

### What you can use in conditions

The field picker includes supported product and variant details, such as tags, title, vendor, product type, category, price, inventory, availability, and whether a price is reduced. It also includes eligible [catalog attributes](https://docs.uselayers.com/platform/attributes/catalog-attributes.md), calculated attributes, [metrics](https://docs.uselayers.com/platform/metrics.md), and existing Layers signals.

For example, you can build a source for products that:

* Have a seasonal tag and are available to buy.
* Have a reduced price and inventory above your chosen threshold.
* Match a custom attribute and exceed a product-performance metric threshold.

Not every attribute is supported. Structured objects and date fields do not appear as collection source conditions. Choose from the available fields rather than assuming every catalog field can be published.

> [!NOTE]
>
> The dashboard uses the visual conditions builder. Sources created through developer tools may use other definition types. Editing their conditions in the dashboard converts them to a conditions-based source when you save.

## Use a published source in Shopify

Publishing creates a reusable source in Shopify. It does not create a collection or attach the source to one automatically.

1. Wait for the source to reach **Published** in Layers.
2. In Shopify admin, create or open the collection you want to manage.
3. Select your published Layers source in the collection's conditions, then save the collection in Shopify.
4. Check the collection's membership in Shopify and on your storefront.

You can reuse the same source in more than one collection. Additional collection conditions can change the final membership, so the Layers preview is a preview of the source, not a guarantee of every collection's final contents.

## Edit, publish, and unpublish

Open a source from the list to change its name or conditions.

* **Save Changes** saves your edits. If the source is already published, Layers also queues an update to Shopify.
* **Publish** saves the current editor values and queues publication to Shopify.
* **Unpublish** saves the current editor values, returns the source to a draft, and queues removal of the published source from Shopify.
* **Delete** removes the source from Layers and queues removal from Shopify. Use **Unpublish** instead if you want to keep the definition for later.

> [!WARNING]
>
> Before unpublishing or deleting a source, review the Shopify collections that use it. Removing a published source changes its availability in Shopify and can affect linked collections. Review their conditions and membership afterward. This does not delete the collections themselves.

You can also publish, unpublish, or delete multiple sources using the selection actions on the list.

### Publication status

| Status | Meaning |
| - | - |
| **Draft** | Saved in Layers but not published to Shopify. |
| **Publishing** | Layers is preparing any required data and synchronizing the source with Shopify. |
| **Published** | The source has been published successfully. |
| **Failed** | Publication could not complete. Review the source and retry after resolving the problem. |

Publishing and membership updates are asynchronous. Changes are not guaranteed to appear immediately in Shopify or on the storefront.

## How membership stays current

When possible, Layers publishes conditions that Shopify can evaluate directly. For conditions Shopify cannot evaluate on its own, Layers maintains a product-level signal in Shopify on your behalf. You do not need to manage those signals manually.

Layers refreshes published signals as the underlying catalog and metric data changes. Allow time for the data refresh, Shopify synchronization, and Shopify's own collection updates before comparing results.

Layers supports up to **10 managed signals per store**, not just 10 sources. Sources that require Layers-managed signals use this capacity, while sources that compile entirely to native Shopify conditions do not. Reused signals can share capacity across sources. Shopify also has its own limit on condition-enabled metafield definitions, shared with other apps and your own setup.

## Troubleshooting

### Collection Sources is missing, or you cannot edit

Check that you are in the correct store and that your role has the required merchandising permissions. Viewing and editing use separate permissions.

### The preview is empty

Confirm that the relevant products and attributes have synced to Layers. Check the selected values and simplify the conditions to identify which requirement excludes the products you expected.

### A published source is not available in Shopify yet

Check that its status is **Published**, not **Draft**, **Publishing**, or **Failed**. Publishing can take longer when Layers must prepare product signals first. If publication fails, correct the conditions or signal-capacity issue and publish again. Contact support if the failure continues.

### You have reached a signal or condition limit

Review unused sources in Layers and condition-enabled metafield definitions in Shopify. Unpublishing or deleting an unused source lets Layers retire signals that no other source needs, but cleanup is asynchronous. Do not remove definitions that another source or app still uses. Where possible, simplify your source to use native product conditions.

### The collection differs from the preview

The preview shows matches in Layers, while the collection reflects Shopify's current data and its saved conditions. Check that the intended source is attached, review any additional conditions, and allow synchronization to finish.

## Next steps

* [Sort orders](https://docs.uselayers.com/platform/sorting.md): choose how collection members are ranked.
* [Merchandising rules](https://docs.uselayers.com/platform/merchandising.md): pin, group, and reorder products within a collection.
* [Catalog attributes](https://docs.uselayers.com/platform/attributes/catalog-attributes.md): understand the product data available for conditions.
* [Metrics](https://docs.uselayers.com/platform/metrics.md): configure product-performance data for metric-based conditions.
