# How to add custom field to topic?

**URL:** <https://meta.discourse.org/t/how-to-add-custom-field-to-topic/57948>\
**Category:** Development\
**Created:** [February 25, 2017, 4:46pm UTC](https://meta.discourse.org/t/how-to-add-custom-field-to-topic/57948 "2017-02-25T16:46:16Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jafeth.diazc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jafeth.diazc/32/101197_2.png) [@jafeth.diazc](https://meta.discourse.org/u/jafeth.diazc)\
**Post date:** [March 6, 2017, 1:30am UTC](https://meta.discourse.org/t/how-to-add-custom-field-to-topic/57948/3 "2017-03-06T01:30:21Z")

</div>

Hello @Janno_Liivak,

As far as I know, `TopicViewSerializer` does not include a `custom_fields` field by default. With your call to `add_to_serializer` you could access directly to a field called `bumped_at_with_button`. However, If you want to access to that field through a `custom_fields` field, then I think you should change your code to something like:

```
add_to_serializer(:topic_view, :custom_fields, false) {
  object.topic.custom_fields.slice(:bumped_at_with_button)
}

```

---

_[View the full topic](https://meta.discourse.org/t/how-to-add-custom-field-to-topic/57948)._
