# Data Search using a Custom Data Type

**URL:** <https://forum.bubble.io/t/data-search-using-a-custom-data-type/47046>\
**Category:** Database\
**Created:** [January 17, 2019, 2:44am UTC](https://forum.bubble.io/t/data-search-using-a-custom-data-type/47046 "2019-01-17T02:44:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronny.hom](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ronny.hom/32/39516_2.png) [@ronny.hom](https://forum.bubble.io/u/ronny.hom)\
**Post date:** [January 17, 2019, 2:44am UTC](https://forum.bubble.io/t/data-search-using-a-custom-data-type/47046/1 "2019-01-17T02:44:25Z")

</div>

Hi,

I am trying to do a simple search of the User data type, where I added a new field called “Baseball Team” with a custom data type I created called “Baseball Team”.

In the data type Baseball Team there are names of baseball teams. So a user can be part of one baseball team.

So now I want to do a data search for all users on a specific baseball team, but the name of the baseball team is in the Baseball Team data type (and not the User data type).

I try to do a search on the User datatype by adding a search constraint using the Baseball Team field. But since the Baseball Team field is a Baseball Team custom data type… I am not sure how to do this

Any ideas?

thank you very much 🙂

---

<div class="post-metadata">

**Author:** ![ronny.hom](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ronny.hom/32/39516_2.png) [@ronny.hom](https://forum.bubble.io/u/ronny.hom)\
**Post date:** [January 17, 2019, 3:02am UTC](https://forum.bubble.io/t/data-search-using-a-custom-data-type/47046/2 "2019-01-17T03:02:18Z")

</div>

I figured out how to do it and will document it for other people

I ended up just doing a search of Users, added a constraint where the Baseball Team = (a do search of Baseball Teams, added a constraint where Baseball Team Name = Dodgers) and added :firstitem to the Baseball Teams search constraint

and that worked !!!

The key thing is that " :firstitem " must be added to the constraint or it won’t work

😄
