# Visual Builder

### Create a new segment

To create a segment using the visual builder, follow these steps:

* **Select the type of segment you want to create** - A user segment to build a list, an event segment for all transactional use cases, or a custom segment (company, product, etc.).
* **Select a Source Entity** - Select the entity you want to use as the basis for your user segment. This could be any entity from your connected data sources, such as Customers, Orders, Products, or any other relevant entity.
* **Filter Data Based on Properties** - After selecting the source entity, you can filter the data based on the properties of that entity. For instance, you can filter customers based on their location, age, or any other relevant property.\
  \
  Icons next to each field name in the Segment Builder indicate their data type, making it easier to understand which rules apply to each field at a glance.\
  \
  You can add as many filters as you want, and combine them using the AND/OR operators.

<figure><img src="/files/yM488bndnU7J3q5sxoKB" alt=""><figcaption></figcaption></figure>

#### **Filter Data Based on Related Models**

You can also filter data based on related entities, such as Orders or Order Lines. For instance, you can select all customers who made at least 2 orders in the last year. You can also filter data based on entities related to related entities, such as selecting all customers who made an order in which there is an order line corresponding to a given product.\
\
\&#xNAN;*In the example below, we take all those over 20 years of age, who have already had a discount total greater than 80% of customers, and who prefer to be contacted by SMS.*

<figure><img src="/files/lNou7xYEKJKRLMMhg0DP" alt=""><figcaption><p>You can add filters from related models by clicking on "<em>Choose a related model</em>"</p></figcaption></figure>

#### **Filter Data Based on Existing Segments**

Finally, you can filter data based on existing user segments from the same parent model. For instance, you can exclude all users from a specific segment, or include only users from a specific segment.

<figure><img src="/files/ei3E2COUKVGrVPLqVczY" alt="" width="563"><figcaption></figcaption></figure>

#### Limit segment size

To reduce or control the size of your segment:

* Click the **Limit Segment Size** icon
* Specify the maximum segment size
* Choose **Top** or **Bottom** and select a meaningful column to sort by, such as:
  * Numeric (e.g. <kbd>revenues</kbd>)
  * Date (e.g. <kbd>last\_purchase\_date</kbd>)
  * String (e.g. <kbd>country</kbd>)
* Specify how *null* values should be handled: ignore them or place them first/last.

<figure><img src="/files/UvCAXOyPePs5zQlwMfg5" alt=""><figcaption></figcaption></figure>

:bulb: *The **Top** and **Bottom** operators allow you to rank values per customer and select a subset based on that ranking. **Top** sorts values in descending order and returns the first X entries, while **Bottom** also sorts in descending order but returns the last X entries.*

This same Top/Bottom logic can be applied both in the **Segment Builder** and in **Calculated Fields** to focus on the most or least significant records per customer.

### Configure your Segment

Once your segment is ready, click on *Preview* and *Continue* to access the configure Page, then fill in the Segment Name, description, and tags.

<figure><img src="/files/1FKKXy7J0T4Q2aqHbP2U" alt=""><figcaption></figcaption></figure>

***

## Ready to get started?

Book a demo and we will walk through the best way to launch your first DinMo use case.

[Book a demo](https://www.dinmo.com/contact/)

## Need help?

Our team is here to help with setup, modeling, activation, and troubleshooting.

[Contact us](mailto:hello@dinmo.com?subject=Docs%20help)

## Feature requests?

Tell us which connector, workflow, or improvement would make DinMo more useful for your team.

[Request a feature](mailto:hello@dinmo.com?subject=Feature%20request)

[Privacy Policy](https://www.dinmo.com/legals/privacy/) | [Terms of Service](https://www.dinmo.com/terms-of-service/)


---

# 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.dinmo.io/segments/visual-builder.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.
