# How to use HubSpot advanced filters?

### Advanced filter structure

* property name (e.g. '*dealstage'*)
* condition (one of the available options: e.g. *Equal*)
* value (e.g. '*closedwon'*)

The **property name** can be taken from HubSpot UI in the same way as you get a custom field internal name: [**How to find HubSpot columns names**](https://help.coupler.io/article/228-how-to-find-hubspot-columns-names)**.**

The **condition** can be selected from the following pre-defined drop-down list:

* *Equal -* equal to the specified value
* *Not equal -* not equal to the specified value
* *Greater than -* greater than the specified value
* *Greater than or equal to -* greater than or equal to the specified value
* *Less than -* less than the specified value
* *Less than or equal to -* less than or equal to the specified value
* *Contains -* contains the specified value. You can use wildcards (\*) to complete a partial search. For example, use the value \*@hubspot.com to retrieve all emailswith a HubSpot email address.
* *Doesn’t contain -* doesn't contain the specified value.
* *Has a value -* has a value for the specified property.
* *Doesn’t have a value -* doesn't have a value for the specified property.&#x20;

The  **value** should be defined by the user for all conditions except "Has a value" and "Doesn’t have a value": it can be the name of the deal stage, the status of the lead, the amount value for the deal amount, etc.

### Conditions allowed per field type

Each field in HubSpot has its type: it can be single-line text, radio button select, multiple select, etc.

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331bc569c3e7c7d6a1ac78e/file-xBUIWoL9Ex.png)

Depending on the field type, different conditions can be used:

| **Type**               | **Allowed Conditions**                                                                                                                                  | **Property example**                  |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| Single-line text       | <p>Equal / Not equal</p><p>Contains / Doesn’t contain</p><p>Has a value / Doesn’t have a value</p>                                                      | Deal name, Company name               |
| Multiple-line text     | <p>Equal / Not equal</p><p>Contains / Doesn’t contain</p><p>Has a value / Doesn’t have a value</p>                                                      | Deal description, Company description |
| Single on/off checkbox | <p>Equal / Not equal</p><p>Has a value / Doesn’t have a value</p>                                                                                       | Company "Is Public" property          |
| Multiple checkbox      | <p>Equal / Not equal</p><p>Has a value / Doesn’t have a value</p>                                                                                       | Company "Web technologies" property   |
| Dropdown select        | <p>Equal / Not equal</p><p>Has a value / Doesn’t have a value</p>                                                                                       | Deal pipeline, Deal priority          |
| Radio select           | <p>Equal / Not equal</p><p>Has a value / Doesn’t have a value</p>                                                                                       | Deal stage, Lead status               |
| Date picker            | <p>Equal / Not equal</p><p>Greater than / Less than</p><p>Greater than or equal to / Less than or equal to</p><p>Has a value / Doesn’t have a value</p> | Last Activity Date                    |
| Number                 | <p>Equal / Not equal</p><p>Greater than / Less than</p><p>Greater than or equal to / Less than or equal to</p><p>Has a value / Doesn’t have a value</p> | Amount, Revenue                       |
| Calculation            | <p>Equal / Not equal</p><p>Greater than / Less than</p><p>Greater than or equal to / Less than or equal to</p><p>Has a value / Doesn’t have a value</p> | Exchange rate                         |
| Score                  | <p>Equal / Not equal</p><p>Greater than / Less than</p><p>Greater than or equal to / Less than or equal to</p><p>Has a value / Doesn’t have a value</p> | Contact score                         |

### Advanced filter setup guide (example)

***User case:** I want to fetch deals on the "Deal postponed" stage (it is a custom stage added on the HubSpot side) of the "Sales Pipeline" default pipeline.*

#### **Action #1:** Identify the name of the deal stage property in HubSpot:

1. Go to HubSpot -> Settings (use the gearwheel icon in the top right corner).

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331ab168b1e2859512fd74c/file-JOt1tdG9EX.png)
2. Navigate to '*Data management'* -> '*Properties'*.

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331ab35e42649264a92ce11/file-MUWeOxnfgh.png)
3. Select '*Deal properties*' in the Select an object drop-down.

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331ab4f8b1e2859512fd750/file-b4r2gmSD2m.png)
4. Use the search field to type the name of the field.

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331ab6d897d4809473f3226/file-8a7nhrxVmS.png)
5. Click '*Deal stage*', then click the '*\</>*' icon.&#x20;

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331aba4897d4809473f322b/file-ka6hkNvsSI.png)
6. The internal name is the name of the property in HubSpot. Copy it.

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331abc4897d4809473f322c/file-7vLZ0hAIaA.png)

#### **Action #2:** Select the condition from the predefined list.

'Deal stage' has a 'Radio select' field type in HubSpot, i.e. it has one of the defined values. As we want to only export deals with the 'Deal postponed' stage, we can only use 'EQ' as a condition rather than 'CONTAINS\_TOKEN'.

#### **Action #3:** Define an internal name for the "Deal postponed" stage.

1. Go to HubSpot -> Settings (using the gearwheel icon in the top right corner).

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331ab168b1e2859512fd74c/file-JOt1tdG9EX.png)
2. Navigate to '*Data management'* -> '*Object'* -> '*Deals*'.&#x20;

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331ae5e9c3e7c7d6a1ac708/file-gJcaAtcU0D.png)
3. Navigate to the '*Pipelines*' tab.&#x20;

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331aeb8897d4809473f323e/file-2HxiivpeGl.png)
4. Select the needed pipeline.&#x20;

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331aeee9c3e7c7d6a1ac70f/file-iLe8hHjLVF.png)
5. Click the '*\</>*' icon for the needed deal stage.&#x20;

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331af0ee42649264a92ce2a/file-60Fhx6X5SU.png)
6. Copy the Internal id.

   ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331af479c3e7c7d6a1ac711/file-brGYZOmMci.png)

#### **Action #4.** Build filter in Coupler.io wizard:

Once you define the property, condition, and value, you can insert them into the Advanced filters field of your HubSpot data flow. In our example, it looks as follows:

* Property: *dealstage*
* Conditio&#x6E;*: Equal*
* Valu&#x65;*: 16301206*

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63c58306b5103a7b33a8b879/file-Yzm9i5Q1MV.png)

### Filters example per data entity

#### Deals

**Fetch Deals with a specific pipeline**

* Property: *pipeline*
* Conditio&#x6E;*: Equal*
* Valu&#x65;*: <\<internal ID>>*
  * *"default" for HubSpot default "Sales" Pipeline:*

    ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63329291897d4809473f36d7/file-vUqwcSmeND.png)
  * *numeric ID for the created custom pipeline:*

    ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331b45fc5dd38351401b8ac/file-Yg5VeQtwGV.png)

Coupler.io settings:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63c66e342b293e06999c41d7/file-PhdN17ZdrZ.png)

**Fetch Deals with a specific status (stage)**

* Property: *dealstage*
* Conditio&#x6E;*: Equal*&#x20;
* Value:
  * *default stage names (*&#x61;ppointmentscheduled, qualifiedtobuy, presentationscheduled, decisionmakerboughtin, contractsent, closedwon, closedlost)
  * *custom deal stage - should be the internal id of created stage:*

    ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331b540e42649264a92ce5c/file-G3BVuHfoo0.png)

Coupler.io settings:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63c66e502b293e06999c41d8/file-NngmYHwtb2.png)

**Fetch Deals with a Record ID greater than XXX**

* Property: *hs\_object\_id (internal name of "Record Id" field)*&#x20;

  ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331b5d18b1e2859512fd7a9/file-Lv1uuQ5s2N.png)
* Conditio&#x6E;*: Greater than*
* Value: *id of the deal you want to start with (can be copied from Deal view page URL):*

  ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331b64a9c3e7c7d6a1ac75a/file-8bARxXpKoy.png)

Coupler.io settings:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63c66e012510956d7c4072ea/file-XDZvu1wlEk.png)

#### Contacts

**Fetch Contacts with a specific original source**

* Property: *hs\_analytics\_source* (internal name of the "Original source" field)

  ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331b827897d4809473f329a/file-Hl3PRsv2cL.png)
* Condition: *Equal*
* Value: *internal value for one of the options provided by HubSpot:* ORGANIC\_SEARCH, PAID\_SEARCH, EMAIL\_MARKETING, SOCIAL\_MEDIA, REFERRALS, OTHER\_CAMPAIGNS, DIRECT\_TRAFFIC, OFFLINE, PAID\_SOCIAL

  ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331b8c09c3e7c7d6a1ac76e/file-isRoQQwfbd.png)

Coupler.io settings:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63c5835ab5103a7b33a8b87b/file-gi5aMwk63n.png)

#### Company

**Fetch Companies with a city that has "New" in the name**

* Property: *city (internal name of "City" field)*&#x20;

  ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331ba489c3e7c7d6a1ac77c/file-U0yI3ev1fr.png)
* Condition: *Contains*
* Value: *new*

Coupler.io settings:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63c5837773fe9e2ed71e66bd/file-CWHPCvrOsq.png)

**Note:** Value for this condition is not case sensitive and counts as a separate word, so if "new" is a filter value => cities "New York", "new mexico", "NEW DELHI" will be found, **BUT** "Newfoundland" will be skipped.

#### Product

**Fetch Product with assigned owner date >= some date**

* Property: *hubspot\_owner\_assigneddate (internal name of "Owner Assigned Date" field)*

  ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331dd96c5dd38351401b9d2/file-lvf2PSussH.png)
* Condition: *Greater than or equal to*
* Value: date in timestamp in milliseconds format *-> i.e. 2022-01-01 -> 1640995200000*

  ![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6463754ac27c2c5c1df59c2f/file-KiQfgEQC3K.png)

  *You can use any online tool to transform date into timestamp - i.e.* [*https://www.epochconverter.com/*](https://www.epochconverter.com/)

Coupler.io settings:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/64637592c27c2c5c1df59c30/file-cwTWvmVEEZ.png)

### Combine few filters

It is possible to add up to 2 advanced filters. Their conditions will be applied using AND logical operator:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63c584771de8565a3847f073/file-E2FOzIrH2y.png)

This filter setup example returns deals of the "Closed Won" stage from the default "Sales" pipeline.

It's also possible to combine the date filter with the advanced filter if necessary. In this case, you can only use 1 date filter and 1 advanced filter:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/63c584aab5103a7b33a8b87f/file-iQKXoy5DLY.png)

This filter setup example returns deals of the "Closed Won" stage created from the beginning of this month.

#### Possible errors

**Error #1.** If you use more than 2 filters (any: date or advanced), you receive an execution error:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/6331e2d0897d4809473f33a9/file-GCVbN4tBIC.png)

To fix this issue, you need to remove extra filters to have only 2 filters (both date and advanced).

**Error #2.** In case of an error after the data flow runs with filters setup, it can be that the used property/condition/value is wrong or the filter by this property is not available:

![](https://s3.amazonaws.com/helpscout.net/docs/assets/57fbf3029033600277a688ab/images/646f33b1549b2b747a06a1f7/file-fDfDyRqGtT.png)

To fix this issue, you need to review if you set up the filter properly. Please check the values used for:

* property name (it should be HubSpot internal key - [see how to get it](https://help.coupler.io/article/228-how-to-find-hubspot-columns-names)).
* value
  * it should be the value of proper type - e.g. timestamp in ms for date properties or number in case you use Greater/Less operators
  * it should value from the predefined list - in case you use a filter for pipeline, stage, etc.

and edit them to have a valid filter.

> If you cannot set up the needed filter or are not sure if HubSpot allows filtering by the needed property - write to our support team and we will help you!
