# Example with 2 decision rules

Let's say that you are creating a **Database -> HubSpot** and you have companies store in the following table and want to send this data to HubSpot Companies. Our database store companies with same ID and same name for each subsidiary but with different "City".

| ID   | Name     | City  |
| ---- | -------- | ----- |
| 1234 | Acme Ltd | Milan |
| 1234 | Acme Ltd | Rome  |

Let's say that on HubSpot we already have the current data:

| ID   | Name     | City  |
| ---- | -------- | ----- |
| 1234 | Acme Ltd | Milan |

We can build our decision rules like this:

IF \[ **Company Name** ]\
\= 0: **ADD**\
\= 1: **NEXT**\
\> 1: **NEXT**

IF \[ **City** ]\
\= 0: **ADD**\
\= 1: **UPDATE**\
\> 1: **STOP**

And choosing as **Decision Algorithm** the "**Funnel**" option.

The cases for each of the 2 records on database will be:

* *For the first record*: The first IF will trigger the "= 1" rule and the second the "=1" rule and it will result in an UPDATE decision.
* *For  the second record*: The first IF will trigger the "= 1" as well, but the second will trigger the "= 0" rule and it will result in an ADD decision.


---

# 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.erpbridge.io/the-operation/3-decision-rules/example-with-2-decision-rules.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.
