# How to assign documents to a product when it is created

Create a business rule with a "product is created"-[trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details).  Then set up [conditions](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/conditions/condition-details) that will check what kind of documents that should be attached.\
\
In this example the [attribute](https://docs.struct.com/pim3/fundamental-concepts/attributes) "Article" is checked.&#x20;

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FtZg3WZKW2X6SPWke5tlq%2Fimage.png?alt=media&#x26;token=abe9e9bb-d2a3-4c07-a0c2-980835549684" alt="" width="563"><figcaption></figcaption></figure>

If the [attribute](https://docs.struct.com/pim3/fundamental-concepts/attributes) is a type we know needs a document attached we can update that document using the "Update attribute"-action.\
\
In this case the Documents [attribute](https://docs.struct.com/pim3/fundamental-concepts/attributes) is updated.

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FQiWXzqu457qt9fuekfl0%2Fimage.png?alt=media&#x26;token=a60ce5e9-9d85-4785-84d6-b39cd17f6ab8" alt="" width="563"><figcaption></figcaption></figure>

The "else"-case is left empty so if future products that does not fit into the other [conditions](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/conditions/condition-details) are created they will not have documents attached to them.&#x20;
