# Canvas mapColumn and essql query

**URL:** <https://discuss.elastic.co/t/canvas-mapcolumn-and-essql-query/314334>\
**Category:** Kibana\
**Tags:** canvas\
**Created:** [September 13, 2022, 8:01pm UTC](https://discuss.elastic.co/t/canvas-mapcolumn-and-essql-query/314334 "2022-09-13T20:01:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobinIT](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/robinit/32/57833_2.png) [@RobinIT](https://discuss.elastic.co/u/RobinIT)\
**Post date:** [September 13, 2022, 8:01pm UTC](https://discuss.elastic.co/t/canvas-mapcolumn-and-essql-query/314334/1 "2022-09-13T20:01:58Z")

</div>

Hi,  
I'm wondering if it is possible to use an essql query in a mapColumn.  
I try to make second column and want to use the value in the first column to check if it exists in another index by using an essql query.

But I can not get it working for now I only get Null values, and I don't know how to use the getCell in the essql statement:

```auto
| var_set name="hosts" value={essql query="select scanner.target as targets from \"logs-scanner-scanlog\""}
| var name="hosts"
| mapColumn name="Critical" expression={ essql "select count(scanner.vcctarget) from \"reports-scanner-data\"" }
| table 
| render

```

---

<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:** [October 11, 2022, 8:02pm UTC](https://discuss.elastic.co/t/canvas-mapcolumn-and-essql-query/314334/2 "2022-10-11T20:02:24Z")

</div>

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