# Canvas switch case not working after first case

**URL:** <https://discuss.elastic.co/t/canvas-switch-case-not-working-after-first-case/288627>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [November 8, 2021, 12:51pm UTC](https://discuss.elastic.co/t/canvas-switch-case-not-working-after-first-case/288627 "2021-11-08T12:51:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MTV](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@MTV](https://discuss.elastic.co/u/MTV)\
**Post date:** [November 8, 2021, 12:51pm UTC](https://discuss.elastic.co/t/canvas-switch-case-not-working-after-first-case/288627/1 "2021-11-08T12:51:26Z")

</div>

Hi,

I am trying to use switch cases in canvas kibana (7.14) but it's not working.  
I tried to use the demo data with the following code:

```auto
demodata
| mapColumn "project_map"
  fn=${getCell "project" |
    switch
      {case if={compare eq to="kibana"} then="kibana"}
      {case if={compare eq to="elasticsearch"} then="elasticsearch"}
      {case if={compare eq to="beats"} then="beats"}
      default="other"
  }
| table
| render

```

and ended up with this result:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/9/593d4321351290916338e7c388d666f428a8ad1b.png)

It appears that after the first case, nothing else works. I really need to map a column in the same way as shown here, so if there's an alternative I would really appreciate if you could share.

Thanks!

---

<div class="post-metadata">

**Author:** ![brianseeders](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brianseeders/32/84831_2.png) [@brianseeders](https://discuss.elastic.co/u/brianseeders)\
**Post date:** [November 10, 2021, 5:03pm UTC](https://discuss.elastic.co/t/canvas-switch-case-not-working-after-first-case/288627/2 "2021-11-10T17:03:42Z")

</div>

Hey @MTV,

I believe there was a bugfix related to this problem, I just cannot find the release note or Github issue for it. I'm able to reproduce the problem using a 7.14.0 cluster, but it's working correctly in 7.14.2 and 7.15.1.

So, I believe if you're able to upgrade, it will fix the issue.

Thanks  
Brian

---

<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:** [December 8, 2021, 5:04pm UTC](https://discuss.elastic.co/t/canvas-switch-case-not-working-after-first-case/288627/3 "2021-12-08T17:04:29Z")

</div>

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