> For the complete documentation index, see [llms.txt](https://docs.dinmo.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dinmo.io/segments/visual-builder.md).

# 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.
* **Preview available data** - Before defining conditions, inspect the fields and values available in the source entity and its related models. This helps you choose the right model and fields for your segment.
* **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/SLhWZ30vdQX5BDqWbHwg" alt="Property filters in the Segment Builder"><figcaption><p>Build property rules with AND/OR logic.</p></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.*

Click **Filter using a related model** and select the related model you want to filter.

<figure><img src="/files/Hoa4AUczSrE0ziMUtPOU" alt="Related model picker in the Segment Builder"><figcaption><p>Select the related model to use in your filter.</p></figcaption></figure>

<figure><img src="/files/QWHpWcngb2upPop0LWWi" alt="Configured related model filter in the Segment Builder"><figcaption><p>Configure aggregation and property conditions for the related model.</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/SqqJmynz21o9oF2VTBY0" alt="Existing segment filter in the Segment Builder"><figcaption><p>Include or exclude existing segments from the same parent model.</p></figcaption></figure>

### Master exclusion lists

After a model has been created, a user with access to the model can configure a master exclusion list from the model's **Segments** tab. When this is configured, the Segment Builder adds it as an **Exclude All** condition. The condition is managed at the model level, so it cannot be removed from an individual segment.

To add, change, or remove a master exclusion list, open the parent model and update its configuration. See [Master exclusion list](/models/overview.md#master-exclusion-list) for the full workflow and its impact on existing segments.

### Limit segment size

To reduce or control the size of your segment:

* Turn on **Limit this segment size**
* 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/S8GzhJSrPTGXoKCARYce" alt="Segment size limit controls"><figcaption><p>Set a size limit and sort the records used to build the segment.</p></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 configuration page. Enter a name and description, then add tags to help organize and find the segment across your workspace.

For the general concept and examples, see [Tags](/core-concepts.md#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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.dinmo.io/segments/visual-builder.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
