# Creating a new dynamic segment

1. Go to the **Contacts -> MessageFlow Segments** tab.
2. Click the **+ New dynamic segment** button in the upper right corner.

<figure><img src="https://1762163817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDIGjHYIXYoHyJoOeeUgD%2Fuploads%2FB7Fr1x6EDFlPvZELH6RC%2Fobraz.png?alt=media&#x26;token=a3fb9b6d-4a69-481e-bbf7-0397747b1a69" alt=""><figcaption></figcaption></figure>

4. **Basic Information:**

* **Group name:** Enter a unique and easily identifiable name for your segment (required field).
* **Description:** Add an optional description to clarify the segment's purpose.

<figure><img src="https://1762163817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDIGjHYIXYoHyJoOeeUgD%2Fuploads%2FzWC5SPZnGYgmmuyKXKRy%2Fobraz.png?alt=media&#x26;token=6b420975-483f-4f33-8535-497493f04602" alt=""><figcaption></figcaption></figure>

4. **Condition Configuration:**

* **Logic within a condition group:** Within a single group (e.g., "Segment 1"), decide whether contacts must meet **all** of the defined conditions or **any** of them.
* **Defining a single condition:**
  * **Data type:** Choose the data source for the condition. \
    (Check [#how-dynamic-segments-work-data-sources](https://docs.messageflow.com/advanced-features/messageflow-segments#how-dynamic-segments-work-data-sources "mention")).
  * **Operator:** Select a logical operator (e.g., Equals, Contains, Before). The available operators depend on the selected data type.
  * **Value:** Enter the value to compare against.

<figure><img src="https://1762163817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDIGjHYIXYoHyJoOeeUgD%2Fuploads%2FpOfn30s8CReaMfKUbZKG%2Fobraz.png?alt=media&#x26;token=4341d57d-2b48-4826-ad9a-483ea9e0cce1" alt=""><figcaption></figcaption></figure>

* **Adding more condition groups:** You can add more independent condition groups (e.g., subsegment or "Segment 2") and connect them to the first group using **and** / **or** logic.

<figure><img src="https://1762163817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDIGjHYIXYoHyJoOeeUgD%2Fuploads%2FOcw2YvhR0ajP39DGyQZv%2Fobraz.png?alt=media&#x26;token=3c8e43f7-69bf-46fc-9547-683e60e54b5d" alt=""><figcaption></figcaption></figure>

5. After configuring all conditions, click **Create** to save the dynamic segment definition.

### **Using Dynamic Segments**

* **For panel campaigns only:** Defined dynamic segments can only be used as target groups for campaigns (email, SMS, push) created and sent from the MessageFlow panel.
* **On-the-fly generation:** The actual list of contacts meeting the segment's criteria is dynamically generated the moment you select the segment as the target for a campaign and initiate the send.
* **No API access:** It is not possible to retrieve the list of contacts belonging to a dynamic segment via the API to target campaigns initiated from external systems.

### **Detailed Segmentation Operators**

Below is a list of available operators for each data type.

* **Custom Fields (contact attributes):**
  * **Text:** `equals`, `is not equal to`,  `starts with`, `ends with`, `contains`, `doesn't contain`, `has no value`.
  * **Number:** `=`, `>`, `<`, `between`, `has no value`.
  * **Date:** `equals`, `not equals`, `is not equal to`, `before`, `after`, `between`,`has no value`.
  * **Boolean (true/false):** `is true`, `is false`, `has no value`.
* **Website Visits:** *(Note: Please confirm the specific criteria with our support team).*
* **System Events:**
  * **Event occurred:** `PushClick`, `MailClick`, `SmsClick`, `MailOpen`.
  * **Event did not occur:** `PushClick`, `MailClick`, `SmsClick`, `MailOpen`.
* **Custom Events (API):** *(Note: The available criteria depend on the events and their attributes you send. Please confirm the details with our support team).*
