# 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="/files/ErKtBYB8mkf1cbahv4lb" alt=""><figcaption><p>Business rules page</p></figcaption></figure>

<figure><img src="/files/4eRfjNbQAFzShFDcg5qD" alt=""><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.\
When you are happy with the name and description click 'Next'.

<figure><img src="/files/RZ2NiUg78wn2K4LHpWZj" alt=""><figcaption><p>Select trigger</p></figcaption></figure>

Now you need to choose a trigger. To do so, click "Click to select a trigger". This will open a select trigger wizard. &#x20;

<div align="center"><figure><img src="/files/nmip4ODb1LmHfXBlijMz" alt=""><figcaption><p>Select trigger</p></figcaption></figure> <figure><img src="/files/W3npxxh8LYJlhV3MowpN" alt=""><figcaption><p>Configure trigger (Variant value changed)</p></figcaption></figure></div>

Within the wizard you must first choose a [trigger](/reference/settings/data-governance/business-rules/business-rule-details/triggers/trigger-details.md) 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](/reference/settings/data-governance/business-rules/business-rule-details/triggers/trigger-details.md) 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'. <br>

<div><figure><img src="/files/fG6k7buKuRMoGir341am" alt=""><figcaption><p>Select action</p></figcaption></figure> <figure><img src="/files/BOubvzJ1uVq8v7uAz0uS" alt=""><figcaption><p>Configure action (Create a task)</p></figcaption></figure></div>

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

<figure><img src="/files/mGTZOfoL3HqHLwugexdl" alt=""><figcaption></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](/reference/settings/data-governance/business-rules/business-rule-details/triggers/trigger-details.md) or [action](/reference/settings/data-governance/business-rules/business-rule-details/actions/action-details.md) you want to edit. A ![](/files/gfa3k8jjHCl3vZn7TXii) symbol will appear in the top right corner. Editing an [action](/reference/settings/data-governance/business-rules/business-rule-details/actions/action-details.md) or [trigger](/reference/settings/data-governance/business-rules/business-rule-details/triggers/trigger-details.md) will allow you change the configuration but not the type.&#x20;

To delete an [action](/reference/settings/data-governance/business-rules/business-rule-details/actions/action-details.md) or [trigger](/reference/settings/data-governance/business-rules/business-rule-details/triggers/trigger-details.md) simply click the "Trash can"-icon when hovering over them. If you delete the [trigger](/reference/settings/data-governance/business-rules/business-rule-details/triggers.md) you will delete the entire rule setup for your business rule.

[Actions](/reference/settings/data-governance/business-rules/business-rule-details/actions/action-details.md) can be dragged around to change the order in which they execute.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.struct.com/tutorials/guides/how-to-use-business-rules/how-to-set-up-and-edit-a-business-rule.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
