# Shouldn't I get the contact in a segment in this situation?

**URL:** <https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485>\
**Category:** Product Support\
**Created:** [June 16, 2022, 10:52pm UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485 "2022-06-16T22:52:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![xmontero](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/xmontero/32/7499_2.png) [@xmontero](https://forum.mautic.org/u/xmontero)\
**Post date:** [June 16, 2022, 10:52pm UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/1 "2022-06-16T22:52:27Z")

</div>

**Your software**  
My Mautic version is: v4.1.0

1. I have a user with tag “catching-up”:

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5441257b740672855532365bdbfcf9c426eef4ca.png)

1. I have a segment with a filter sayin to “include” cathing-up as a tag:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/d/d9f465c27e48261904d2c6ddba16230c0e6d9222.png)

1. But the segment does not get the user in:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/7/721d57eed78be80eb231eaac0c108cd630497c72.png)

Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [June 17, 2022, 7:08am UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/2 "2022-06-17T07:08:10Z")

</div>

Often, when a segment misbehaves, its usually because

- U have removed that contact from the segment before manually, meaning they cant be added back by a filter (look at the contact history for clues)
- There is an automation somewhere that is removing the person from the segment.
- Something is wrong with how you have set up filters for the segment. (they look correct in your screen grab)

---

<div class="post-metadata">

**Author:** ![sradford](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sradford/32/10465_2.png) [@sradford](https://forum.mautic.org/u/sradford)\
**Post date:** [December 13, 2023, 8:56am UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/3 "2023-12-13T08:56:22Z")

</div>

@robm Can you ‘delete the knowledge’ that they were removed manually from a segment, so that a filter will select them?

Thanks,

Sean

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [December 14, 2023, 9:27am UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/4 "2023-12-14T09:27:17Z")

</div>

Great question. I am not sure.

Anyone have an answer?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 15, 2023, 5:43am UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/5 "2023-12-15T05:43:32Z")

</div>

You can do this only via a mysql query.

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [December 15, 2023, 2:14pm UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/6 "2023-12-15T14:14:44Z")

</div>

A work around might be to create a new segment with the same filter This would be seen as a new segment and they would be added.

Of course this could have knock effects for campaigns that are using these segments.

Or you could manually put them back into the segment if you know who they are and there are not too many.

Perhaps export the contacts in question if there a lot of them, then re-import them and in the import choose the segment to add them to.

---

<div class="post-metadata">

**Author:** ![sradford](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sradford/32/10465_2.png) [@sradford](https://forum.mautic.org/u/sradford)\
**Post date:** [January 13, 2024, 8:50pm UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/7 "2024-01-13T20:50:47Z")

</div>

@joeyk Any idea what that query might be?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 13, 2024, 9:49pm UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/8 "2024-01-13T21:49:26Z")

</div>

Be always careful with mysql direct interventions.  
Assuming your db name is mauticdb, the segment in question is segment 1:

```auto
UPDATE mauticdb
SET manually_removed = 0,
    manually_added = 0
WHERE leadlist_id = 1;

```

---

<div class="post-metadata">

**Author:** ![sradford](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sradford/32/10465_2.png) [@sradford](https://forum.mautic.org/u/sradford)\
**Post date:** [January 15, 2024, 2:33pm UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/9 "2024-01-15T14:33:50Z")

</div>

Hi @joeyk,

Thank you for your reply. I believe your sql is slightly incorrect, but was a massive pointer for me (as I don’t know the underlying Mautic database structure).

UPDATE leadlists\_leads  
SET  
manually\_removed = 0,  
manually\_added = 0  
WHERE  
leadlist\_id = 1

Though I’m thinking that if ‘manually\_removed’, the relevant row should actually just be deleted.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 15, 2024, 3:25pm UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/10 "2024-01-15T15:25:07Z")

</div>

Sorry yes, that’s what I meant. I added the db name instead of table name. Duh.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 15, 2024, 3:26pm UTC](https://forum.mautic.org/t/shouldnt-i-get-the-contact-in-a-segment-in-this-situation/24485/11 "2024-01-15T15:26:18Z")

</div>

If they wouldn’t qualify based on filters, they will be kicked out from the segment by the segment processor script.
