# Boolean preferences

**URL:** <https://forums.plex.tv/t/boolean-preferences/7348>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [January 11, 2011, 10:11pm UTC](https://forums.plex.tv/t/boolean-preferences/7348 "2011-01-11T22:11:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chhitz](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@chhitz](https://forums.plex.tv/u/chhitz)\
**Post date:** [January 11, 2011, 10:11pm UTC](https://forums.plex.tv/t/boolean-preferences/7348/1 "2011-01-11T22:11:11Z")

</div>

Hi,  
  
  
  
I am trying to add some boolean preferences to my v2 plugin ([https://github.com/chhitz/teleboyPlugin](https://github.com/chhitz/teleboyPlugin)). I have added the following to the DefaultPrefs.json:

```auto

[<br />
    {<br />
        "id": "channels_de",<br />
        "label": "German channels",<br />
        "type": "boolean",<br />
        "default": "true"<br />
    },<br />
    {<br />
        "id": "channels_fr",<br />
        "label": "French channels",<br />
        "type": "boolean",<br />
        "default": "false"<br />
    },<br />
    {<br />
        "id": "channels_it",<br />
        "label": "Italien channels",<br />
        "type": "boolean",<br />
        "default": "false"<br />
    },<br />
    {<br />
        "id": "channels_en",<br />
        "label": "English channels",<br />
        "type": "boolean",<br />
        "default": "false"<br />
    }<br />
]

```

  
  
The JSON parses fine (no errors in the log). Also the other (non boolean) preferences work fine. Only the booleans do not appear in the preferences dialog.  
  
Do you have any pointers or suggestions?  
  
Thanks.

---

<div class="post-metadata">

**Author:** ![raindancing](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/raindancing/32/113458_2.png) [@raindancing](https://forums.plex.tv/u/raindancing)\
**Post date:** [January 11, 2011, 10:25pm UTC](https://forums.plex.tv/t/boolean-preferences/7348/2 "2011-01-11T22:25:19Z")

</div>

I’ve had the same problem, and ended up using a [“Yes”,“No”] enum preference as a workaround.

---

<div class="post-metadata">

**Author:** ![mikedm139](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/mikedm139/32/96909_2.png) [@mikedm139](https://forums.plex.tv/u/mikedm139)\
**Post date:** [January 11, 2011, 10:29pm UTC](https://forums.plex.tv/t/boolean-preferences/7348/3 "2011-01-11T22:29:14Z")

</div>

I also ran into that problem, and I’m pretty sure the answer was to use ‘bool’ instead of ‘boolean’.

---

<div class="post-metadata">

**Author:** ![sander1](https://avatars.discourse-cdn.com/v4/letter/s/4bbf92/32.png) [@sander1](https://forums.plex.tv/u/sander1)\
**Post date:** [January 11, 2011, 10:55pm UTC](https://forums.plex.tv/t/boolean-preferences/7348/4 "2011-01-11T22:55:17Z")

</div>

Just to confirm that Mike is correct, there is a mistake in the docs, the correct value to use for a boolean type preferences is indeed **bool**.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 8:57pm UTC](https://forums.plex.tv/t/boolean-preferences/7348/5 "2019-12-20T20:57:17Z")

</div>

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