# How to set up and edit a business rule

## Set up a business rule

To start setting up a new business rule click the "Create business rule"-button in the top right corner of the Business rules page.

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FmJQLTV7SDY17Jjhckkcw%2Fimage.png?alt=media&#x26;token=66195542-45bf-4427-a8ea-fd508f0eea0d" alt="" width="563"><figcaption><p>Business rules page</p></figcaption></figure>

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FUdR1MI99xqfltBtLIAQP%2Fimage.png?alt=media&#x26;token=c1d64c37-ffec-4bbd-8819-50e090230b09" alt="" width="563"><figcaption><p>Business rule setup page</p></figcaption></figure>

You must choose a name for your business rule, this name does not have to be unique because the business rule will be assigned a Uid. We suggest using explanatory and distinct names however, as this wil make it easier for everyone working in the PIM.

You can give the rule a description and choose whether the rule is active or not.&#x20;

Now you need to choose a [trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details). To do so, click "Click to select a trigger". This will open a select trigger wizard. &#x20;

<div align="center" data-full-width="false"><figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2F1HO1idaXgITMPlrZ847V%2Fimage.png?alt=media&#x26;token=fdf88e98-569e-4ec0-b09c-026b314eea21" alt="" width="375"><figcaption><p>Select trigger</p></figcaption></figure> <figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FmkR7FtDD4Tb6vTTujfwC%2Fimage.png?alt=media&#x26;token=9913d726-d06b-432c-8375-c3ed0b81a3fe" alt="" width="375"><figcaption><p>Configure trigger (Variant value changed)</p></figcaption></figure></div>

Within the wizard you must first choose a [trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details) that determines when your rule will run. For this example 'Variant value changed' is chosen.\
\
The wizard will ask you to select any setting for the [trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details) if applicable. In this example the wizard asks what attributes to look for. When you have chosen the necessary settings click "Confirm".&#x20;

This will take you back to the business rule setup page. Under the trigger that was chosen, a box with the text "Execute these actions" will have appeared. Click "Add Action" inside the box to open up 'Select action'.&#x20;

<div><figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FXMnSlWihVob4OM2ucDLR%2Fimage.png?alt=media&#x26;token=ff495789-cf65-4f1a-ad23-f1f31ea85885" alt=""><figcaption><p>Select action</p></figcaption></figure> <figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FfUYlnP6eccWCGDs3lLN6%2FScreenshot%202025-01-09%20140912.png?alt=media&#x26;token=379131d8-d18f-4380-9308-cf42f48eeee8" alt=""><figcaption><p>Configure action (Create a task)</p></figcaption></figure></div>

Choose the [action](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details) you wish for your business rule to execute. The available [actions](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details) depend on the chosen [trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details). For this example "Create a Task" is chosen.\
\
When you have chosen an [action](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details), you will be asked to configure that[ action](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details). In this example we need to set up a task.\
\
When you have configured your [action](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details) click "Confirm". This will take you back to the business rule setup page. Note that you can add more than one [action](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details) to your business rule.&#x20;

<figure><img src="https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2Fm02sVSfjvRUDV5DHHOET%2Fimage.png?alt=media&#x26;token=2da1f574-bd30-486b-82b8-d8e5479c9aa5" alt="" width="563"><figcaption><p>Business rule setup page</p></figcaption></figure>

When you have finished setting up your business rule click "Create business rule". This will save the business rule and assign it a Uid.

To test that your business rule runs; hover your cursor over the trigger and a small "Start"-button should appear in the top right corner of the box.&#x20;

## Edit Business rule

To edit your business rule hover over the [trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details) or [action](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details) you want to edit. A ![](https://3609403033-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZJAMIKVcqchSDbt4A7DE%2Fuploads%2FIRwyjKbMbN9pifTAUD6W%2FScreenshot%202025-01-09%20144110.png?alt=media\&token=f1ebbc91-8650-43e2-a51f-f3c3096dbbd0) symbol will appear in the top right corner. Editing an [action](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details) or [trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details) will allow you change the configuration but not the type.&#x20;

To delete an [action](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details) or [trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details) simply click the "Trash can"-icon when hovering over them. If you delete the [trigger](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/triggers/trigger-details) you will delete the entire rule setup for your business rule.

[Actions](https://docs.struct.com/pim3/reference/product-model-setup/business-rules/business-rule-details/actions/action-details) can be dragged around to change the order in which they execute.&#x20;
