# FieldFormat is not a constructor

**URL:** <https://discuss.elastic.co/t/fieldformat-is-not-a-constructor/142739>\
**Category:** Kibana\
**Created:** [August 2, 2018, 9:57am UTC](https://discuss.elastic.co/t/fieldformat-is-not-a-constructor/142739 "2018-08-02T09:57:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![voix](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@voix](https://discuss.elastic.co/u/voix)\
**Post date:** [August 2, 2018, 9:57am UTC](https://discuss.elastic.co/t/fieldformat-is-not-a-constructor/142739/1 "2018-08-02T09:57:03Z")

</div>

Hi all. I try to get indexPattern by id, using `courier.indexPatterns.get(index);` function, but there is an error "Field format is not a constructor. I tried to import ui/registry/\_registry and ui/registry/field\_formats. but it doesnt work for me. And also I have 'ui/autoload/all' impoted. [http://prntscr.com/kdqx53](http://prntscr.com/kdqx53) This is where plugin stuck - FieldFormat returns undefined. Or maybe there is another way to get indexPattern by id?

---

<div class="post-metadata">

**Author:** ![Joe\_Fleming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_fleming/32/3561_2.png) [@Joe\_Fleming](https://discuss.elastic.co/u/Joe_Fleming)\
**Post date:** [August 3, 2018, 5:46pm UTC](https://discuss.elastic.co/t/fieldformat-is-not-a-constructor/142739/2 "2018-08-03T17:46:34Z")

</div>

I'm not well versed in this code, and it's hard to tell from your screenshot what `FieldFormat` you are using... but if I'm right based on your comment, what you have there is the field formatter registry, not the constructor. Maybe you want `ui/field_formats/field_format`?

---

<div class="post-metadata">

**Author:** ![voix](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@voix](https://discuss.elastic.co/u/voix)\
**Post date:** [August 6, 2018, 6:04am UTC](https://discuss.elastic.co/t/fieldformat-is-not-a-constructor/142739/3 "2018-08-06T06:04:14Z")

</div>

Thanks for the reply, but it doesnt work =( [http://prntscr.com/kf57zi](http://prntscr.com/kf57zi)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 3, 2018, 6:04am UTC](https://discuss.elastic.co/t/fieldformat-is-not-a-constructor/142739/4 "2018-09-03T06:04:27Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
