---
title: "CollectionRuleInput"
description: "Input fields for the rule related to the collection."
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/collection-rule-input'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/collection-rule-input.md'
---
# CollectionRuleInput

Input fields for the rule related to the collection.

- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Input

## Type Signature

`CollectionRuleInput`

## Input Fields

* `condition`

  [String!](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/string.md)

  The value of the operator to apply. For example: Hats

* `column`

  [CollectionRuleColumn!](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/enums/collection-rule-column.md)

  The attribute on which the rule focuses, such as title, product_type.

* `relation`

  [CollectionRuleRelation!](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/enums/collection-rule-relation.md)

  The operator type on which the rule is based. Examples include: equals, contains, or not_equals.

## Schema Definition

```graphql
input CollectionRuleInput { 
	condition: String!
	column: CollectionRuleColumn!
	relation: CollectionRuleRelation! 
}
```

## Input field from

* [CollectionRuleSetInput](https://developer.shopline.com/docs/admin-graph-ql-api/products-and-collections/inputs/collection-rule-set-input.md).rules

  Rules for assigning products to collections.

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

