# Hubdl filter that takes objects based on a given string

**URL:** <https://community.hubspot.com/t/hubdl-filter-that-takes-objects-based-on-a-given-string/88557>\
**Category:** CMS Development\
**Tags:** enterprise\
**Created:** [August 29, 2023, 7:28pm UTC](https://community.hubspot.com/t/hubdl-filter-that-takes-objects-based-on-a-given-string/88557 "2023-08-29T19:28:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ACarrillo7](https://avatars.discourse-cdn.com/v4/letter/a/58f4c7/32.png) [@ACarrillo7](https://community.hubspot.com/u/ACarrillo7)\
**Post date:** [August 29, 2023, 7:28pm UTC](https://community.hubspot.com/t/hubdl-filter-that-takes-objects-based-on-a-given-string/88557/1 "2023-08-29T19:28:44Z")

</div>

I want to get all the contacts whose name contains this string ‘Jeff’, so I can get a result like this ‘Jeffer’, ‘Jefferson’, ‘Jeff’.

{% set events=crm\_objects(“contact”, “firstname\_\_in=Jeff’,”") %}

But it doesn’t work

I guess there is an operator I can use, like

{% set events=crm\_objects(“contact”, “firstname\_\_in=Jeff%',”") %}

Any ideas?

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [August 30, 2023, 10:51pm UTC](https://community.hubspot.com/t/hubdl-filter-that-takes-objects-based-on-a-given-string/88557/2 "2023-08-30T22:51:50Z")

</div>

Hey, @ACarrillo7 👋 My hunch is the ` __in` won’t work the way you are expecting for partial string matching. In this case, the `__ in` operator checks if the value is exactly in a list of specified values, not if it’s a part of any value. So, in this case, `firstname__in=Jeff` will only return contacts whose first name is exactly ‘Jeff’, not ‘Jefferson’, ‘Jeffer’, etc.

You’ll need to look at other approaches, such as creating a function to return all contacts and then filtering all the Jeff’s into an array. I understand this might not be efficient if you have numerous records to deal with.

Best,

Jaycee
