# Custom field that behaves like a tag field?

**URL:** <https://forum.mautic.org/t/custom-field-that-behaves-like-a-tag-field/21116>\
**Category:** Development\
**Created:** [October 2, 2021, 5:55pm UTC](https://forum.mautic.org/t/custom-field-that-behaves-like-a-tag-field/21116 "2021-10-02T17:55:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![modifiedcontent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/modifiedcontent/32/511_2.png) [@modifiedcontent](https://forum.mautic.org/u/modifiedcontent)\
**Post date:** [October 2, 2021, 5:55pm UTC](https://forum.mautic.org/t/custom-field-that-behaves-like-a-tag-field/21116/1 "2021-10-02T17:55:18Z")

</div>

Is there a way to create a custom field for tags? Kinda like a ‘Select - Multiple’ field, but without having to define the options in advance. How do tag fields work anyway?

I am looking for a solution to track event attendees. I would have one field ‘attendee’ in the contact object and then I want to be able to just add event codes as tags from event registration forms via the API etc.

What field type is the built-in ‘tags’ field? I guess the tags field in mysql is lead\_tags, which is a table consisting of an ‘id’ field, type int(11) AUTO\_INCREMENT, and then a ‘tag’ field, varchar(255).

And then there is a key lead\_tag\_search and that is connected in some way to the contact? Can’t wrap my head around it…

Can I leverage this lead\_tags table in some way to create a custom tags field?

Or can I store tags as an array in a regular custom text field? Apparently you can convert and store an array as a flat string, using `json_encode()` , `implode()` , or `serialize()`.

Could I add and remove tags with that approach, via the API? I could just use custom PHP to edit/search/add the $customtags array I guess. But Mautic front end would probably not be able to display $customtags…

Is there a recommended, Mautic-native method?

---

<div class="post-metadata">

**Author:** ![mybpoconsultant](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mybpoconsultant/32/6161_2.png) [@mybpoconsultant](https://forum.mautic.org/u/mybpoconsultant)\
**Post date:** [January 20, 2022, 11:13pm UTC](https://forum.mautic.org/t/custom-field-that-behaves-like-a-tag-field/21116/2 "2022-01-20T23:13:17Z")

</div>

I am also interested in knowing how to do this because I am uploading a list of Twitter Profiles associated with a user that “retweeted” a Twitter Profile and doing data analysis on this information based on other users to create segments. I want it in a custom “tag” field called Twitter Retweets though - There must be a way just to clone the tag field and have it as another field! Did you figure out how to do this @modifiedcontent ?

---

<div class="post-metadata">

**Author:** ![fernando\_jardim](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/fernando_jardim/32/7099_2.png) [@fernando\_jardim](https://forum.mautic.org/u/fernando_jardim)\
**Post date:** [March 26, 2022, 11:48pm UTC](https://forum.mautic.org/t/custom-field-that-behaves-like-a-tag-field/21116/3 "2022-03-26T23:48:12Z")

</div>

Also following this thread!

---

<div class="post-metadata">

**Author:** ![modifiedcontent](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/modifiedcontent/32/511_2.png) [@modifiedcontent](https://forum.mautic.org/u/modifiedcontent)\
**Post date:** [April 3, 2022, 2:14pm UTC](https://forum.mautic.org/t/custom-field-that-behaves-like-a-tag-field/21116/4 "2022-04-03T14:14:31Z")

</div>

I have not made any progress with this; waiting for feedback from developers.
