# \[Bug\] Single Value Chart - Boolean filter

**URL:** <https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580>\
**Category:** Help me!\
**Created:** [July 2, 2020, 4:09pm UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580 "2020-07-02T16:09:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylvain\_GOUMY](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sylvain_goumy/32/461_2.png) [@Sylvain\_GOUMY](https://community.forestadmin.com/u/Sylvain_GOUMY)\
**Post date:** [July 2, 2020, 4:09pm UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/1 "2020-07-02T16:09:57Z")

</div>

## Expected behavior

I want to add a filter on a “Single Value” chart, of type boolean.  
Using MongoDB.  
When I set my filter : “active” \> “is” \> “True”, and click “Save” I expect it to save the configuration and update the single value chart.  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/1bc7e8767d7814d5bbcedc196a0cb29730e5d5a0.png)

## Actual behavior

When I set my filter : “active” \> “is” \> “True”, and click “Save” nothing happened and the filter is not apply.

## Failure Logs

In the console of my browser I can see the following error message when I click “Save”:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/1dc2085c2112ed0424d7e038e8e62f535a20bbb4.png)

## Context

Please provide any relevant information about your setup.

- Package Version:
- Express Version:
- Sequelize Version:
- Database Dialect: Mongoose
- Database Version: MongoDB
- Project Name:

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [July 2, 2020, 4:17pm UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/2 "2020-07-02T16:17:52Z")

</div>

Hey @Sylvain_GOUMY,  
Can you send me the request `Patch /api/layout`  
I’ll try to reproduce when I’ll have some time 😉

---

<div class="post-metadata">

**Author:** ![Sylvain\_GOUMY](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sylvain_goumy/32/461_2.png) [@Sylvain\_GOUMY](https://community.forestadmin.com/u/Sylvain_GOUMY)\
**Post date:** [July 2, 2020, 4:25pm UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/3 "2020-07-02T16:25:46Z")

</div>

Hi Vince,

Here it is.

- as fetch:

```javascript
fetch("https://api.forestadmin.com/api/layout", {
  "headers": {
    "accept": "vnd.forestadmin-api+json; version=2.7.0",
    "accept-language": "en,fr-FR;q=0.9,fr;q=0.8,en-US;q=0.7",
    "authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImRhdGEiOnsidHlwZSI6InVzZXJzIiwiaWQiOiIzNTEwNiIsImF0dHJpYnV0ZXMiOnsiZmlyc3RfbmFtZSI6IlN5bHZhaW4iLCJsYXN0X25hbWUiOiJHT1VNWSIsImVtYWlsIjoic3lsdmFpbkB1cGxhYi5mciJ9fX0sImlhdCI6MTU5MDEzNzA5MSwiZXhwIjoxNjA1Njg5MDkxLCJhdWQiOiJGT1JFU1RfVVNFUlMiLCJpc3MiOiJGT1JFU1RfQVVUSEVOVElDQVRJT05fU1lTVEVNIn0",
    "cache-control": "no-cache",
    "content-type": "application/vnd.api+json",
    "forest-environment-id": "54833",
    "forest-project-id": "45486",
    "forest-rendering-id": "64957",
    "forest-team-id": "45299",
    "pragma": "no-cache",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "cross-site"
  },
  "referrer": "http://app.forestadmin.com/rasaff-admin/Development/Operations/dashboard/a4987950-bc46-11ea-ba73-fb4820c43239/chart/aa9d8e00-bc71-11ea-b713-cbd7733657ee/edit",
  "referrerPolicy": "no-referrer-when-downgrade",
  "body": "[{\"path\":\"/dashboards/a4987950-bc46-11ea-ba73-fb4820c43239/charts/aa9d8e00-bc71-11ea-b713-cbd7733657ee/filter\",\"op\":\"replace\",\"value\":{\"id\":\"aa9d3fe0-bc71-11ea-b713-cbd7733657ee\",\"type\":\"and\",\"conditions\":[{\"id\":\"aa9d3fe1-bc71-11ea-b713-cbd7733657ee\",\"fieldName\":\"client\",\"operator\":\"is\",\"value\":\"test\",\"embeddedField\":null,\"subFieldName\":\"code\"},{\"id\":\"481b6ec0-bc7e-11ea-9221-49b60865fd98\",\"fieldName\":\"active\",\"operator\":\"is\",\"value\":true,\"embeddedField\":null,\"subFieldName\":null}]}}]",
  "method": "PATCH",
  "mode": "cors",
  "credentials": "include"
});

```

- as CURL:

```javascript
curl 'https://api.forestadmin.com/api/layout' \
  -X 'PATCH' \
  -H 'Connection: keep-alive' \
  -H 'Pragma: no-cache' \
  -H 'Cache-Control: no-cache' \
  -H 'Forest-Project-Id: 45486' \
  -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImRhdGEiOnsidHlwZSI6InVzZXJzIiwiaWQiOiIzNTEwNiIsImF0dHJpYnV0ZXMiOnsiZmlyc3RfbmFtZSI6IlN5bHZhaW4iLCJsYXN0X25hbWUiOiJHT1VNWSIsImVtYWlsIjoic3lsdmFpbkB1cGxhYi5mciJ9fX0sImlhdCI6MTU5MDEzNzA5MSwiZXhwIjoxNjA1Njg5MDkxLCJhdWQiOiJGT1JFU1RfVVNFUlMiLCJpc3MiOiJGT1JFU1RfQVVUSEVOVElDQVRJT05fU1lTVEVNIn0' \
  -H 'Forest-Rendering-Id: 64957' \
  -H 'Content-Type: application/vnd.api+json' \
  -H 'Accept: vnd.forestadmin-api+json; version=2.7.0' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36' \
  -H 'Forest-Environment-Id: 54833' \
  -H 'Forest-Team-Id: 45299' \
  -H 'Origin: http://app.forestadmin.com' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: empty' \
  -H 'Referer: http://app.forestadmin.com/rasaff-admin/Development/Operations/dashboard/a4987950-bc46-11ea-ba73-fb4820c43239/chart/aa9d8e00-bc71-11ea-b713-cbd7733657ee/edit' \
  -H 'Accept-Language: en,fr-FR;q=0.9,fr;q=0.8,en-US;q=0.7' \
  -H 'Cookie: _uc_referrer=https://www.google.com/; ajs_anonymous_id=%2234c3a140-81cd-4575-9d6c-d40277585dd3%22; _ga=GA1.2.687213319.1586958791; ajs_user_id=%2235106%22; session_token=nPcuZulBFS98AHOUw5D9uzEGRArf3NICYn2tQFgQDds; _gid=GA1.2.1600306587.1593595148; amplitude_id_fef1e872c952688acd962d30aa545b9eforestadmin.com=eyJkZXZpY2VJZCI6IjVjNjJmNmZiLTY1YTEtNGE0ZS04NDQxLTk4OTM4MTEwYmY4YlIiLCJ1c2VySWQiOm51bGwsIm9wdE91dCI6ZmFsc2UsInNlc3Npb25JZCI6MTU5MzcwNDAyMzYwNCwibGFzdEV2ZW50VGltZSI6MTU5MzcwNDAyNDk0OCwiZXZlbnRJZCI6MSwiaWRlbnRpZnlJZCI6MSwic2VxdWVuY2VOdW1iZXIiOjJ9; _gat=1' \
  --data-binary '[{"path":"/dashboards/a4987950-bc46-11ea-ba73-fb4820c43239/charts/aa9d8e00-bc71-11ea-b713-cbd7733657ee/filter","op":"replace","value":{"id":"aa9d3fe0-bc71-11ea-b713-cbd7733657ee","type":"and","conditions":[{"id":"aa9d3fe1-bc71-11ea-b713-cbd7733657ee","fieldName":"client","operator":"is","value":"test","embeddedField":null,"subFieldName":"code"},{"id":"481b6ec0-bc7e-11ea-9221-49b60865fd98","fieldName":"active","operator":"is","value":true,"embeddedField":null,"subFieldName":null}]}}]' \
  --compressed

```

---

<div class="post-metadata">

**Author:** ![Sylvain\_GOUMY](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sylvain_goumy/32/461_2.png) [@Sylvain\_GOUMY](https://community.forestadmin.com/u/Sylvain_GOUMY)\
**Post date:** [July 2, 2020, 4:42pm UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/4 "2020-07-02T16:42:44Z")

</div>

@anon62739609 let me know if you need more context.  
Thanks 😉

---

<div class="post-metadata">

**Author:** ![anon62739609](https://avatars.discourse-cdn.com/v4/letter/a/c2a13f/32.png) [@anon62739609](https://community.forestadmin.com/u/anon62739609)\
**Post date:** [July 3, 2020, 8:33am UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/5 "2020-07-03T08:33:04Z")

</div>

Hey @Sylvain_GOUMY,  
Sorry I was not clear enough 😅 I need the response 😉

---

<div class="post-metadata">

**Author:** ![Sylvain\_GOUMY](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sylvain_goumy/32/461_2.png) [@Sylvain\_GOUMY](https://community.forestadmin.com/u/Sylvain_GOUMY)\
**Post date:** [July 3, 2020, 9:30am UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/6 "2020-07-03T09:30:06Z")

</div>

hi @anon62739609

My bad ^^

here is the response:

```javascript
{"errors":[{"status":422,"detail":"Invalid patch value (path: \"/dashboards/48c0dde1-bc7b-11ea-845a-add3d3dc0ebf/charts/486f8999-bc7b-11ea-845a-add3d3dc0ebf/filter\", op: \"replace\", value: {\"id\":\"489b7b90-bc7b-11ea-845a-add3d3dc0ebf\",\"type\":\"and\",\"conditions\":[{\"id\":\"48c01a90-bc7b-11ea-845a-add3d3dc0ebf\",\"fieldName\":\"client\",\"operator\":\"starts with\",\"value\":\"test\",\"embeddedField\":null,\"subFieldName\":\"code\"},{\"id\":\"7d355df0-bd0f-11ea-9afc-0be2709e99ba\",\"fieldName\":\"active\",\"operator\":\"is\",\"value\":true,\"embeddedField\":null,\"subFieldName\":null}]}): ValidationError: child \"conditions\" fails because [\"conditions\" at position 1 fails because [child \"value\" fails because [\"value\" must be a string, \"value\" must be a number]]]","meta":{}}]}

```

For these filters:  
 ![image](https://europe1.discourse-cdn.com/flex013/uploads/forest/original/1X/dd77a97a12f1d1f9cb13b2554650917c9edc6951.png)

---

<div class="post-metadata">

**Author:** ![rap2h](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/rap2h/32/25_2.png) [@rap2h](https://community.forestadmin.com/u/rap2h)\
**Post date:** [July 6, 2020, 3:31pm UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/7 "2020-07-06T15:31:44Z")

</div>

Hi @Sylvain_GOUMY thank you for your answer. 🙏

Thanks to the response log you sent, we have been able to reproduce your issue. A fix is on his way (it still needs some peer review first) and should be released in a few days. Be sure we will be notified as soon as it’s released!

---

<div class="post-metadata">

**Author:** ![Sylvain\_GOUMY](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sylvain_goumy/32/461_2.png) [@Sylvain\_GOUMY](https://community.forestadmin.com/u/Sylvain_GOUMY)\
**Post date:** [July 6, 2020, 3:34pm UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/8 "2020-07-06T15:34:13Z")

</div>

Hi @rap2h  
Thanks for your answer and your quick fix.  
I’ll wait for the patch to be deliver.

---

<div class="post-metadata">

**Author:** ![anon36130554](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@anon36130554](https://community.forestadmin.com/u/anon36130554)\
**Post date:** [July 8, 2020, 9:08am UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/9 "2020-07-08T09:08:45Z")

</div>

Hello @Sylvain_GOUMY 👋

A fix has been released regarding this issue, can you confirm that you are able to create charts with boolean values please ?

Tanks in advance,

Steve.

---

<div class="post-metadata">

**Author:** ![Sylvain\_GOUMY](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sylvain_goumy/32/461_2.png) [@Sylvain\_GOUMY](https://community.forestadmin.com/u/Sylvain_GOUMY)\
**Post date:** [July 8, 2020, 2:27pm UTC](https://community.forestadmin.com/t/bug-single-value-chart-boolean-filter/580/10 "2020-07-08T14:27:19Z")

</div>

Hi @anon36130554  
I confirm the bug is resolved.  
Thanks.  
Sylvain
