# Pattern matching on datatable active cell

**URL:** <https://community.plotly.com/t/pattern-matching-on-datatable-active-cell/61727>\
**Category:** Dash Python\
**Created:** [March 8, 2022, 9:49am UTC](https://community.plotly.com/t/pattern-matching-on-datatable-active-cell/61727 "2022-03-08T09:49:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilpepe4](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@ilpepe4](https://community.plotly.com/u/ilpepe4)\
**Post date:** [March 8, 2022, 9:49am UTC](https://community.plotly.com/t/pattern-matching-on-datatable-active-cell/61727/1 "2022-03-08T09:49:30Z")

</div>

Hi,

I making a page with on the left a datatable, and on the right a map (dash-leaflet). The data from the table is represented in on the map, as markers.

I would like to make some kind of functionality that when I click/select a cell in the datatable, the marker is changed of color, or something similar.

The markers have an id, corresponding with the row ids in the table.

So I figured I had to use pattern matching, on the id.  
Input: active cell - row\_id, output id of the marker.

But I’m unsure how I can implement the row\_id as an input?

```auto
app.callback(
INPUT({'type': ?, 'index': MATCH}, id),
OUTPUT({'type': 'marker', 'index': MATCH}, icon
)
def ...

```

Any tips?

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [March 8, 2022, 2:12pm UTC](https://community.plotly.com/t/pattern-matching-on-datatable-active-cell/61727/2 "2022-03-08T14:12:07Z")

</div>

Hi @ilpepe4

You don’t need to use pattern matching for this. You can see an example of something similar here: [Button inside a Dash Table - #5 by AnnMarieW](https://community.plotly.com/t/button-inside-a-dash-table/51460/5)

---

<div class="post-metadata">

**Author:** ![ilpepe4](https://avatars.discourse-cdn.com/v4/letter/i/94ad74/32.png) [@ilpepe4](https://community.plotly.com/u/ilpepe4)\
**Post date:** [March 8, 2022, 2:19pm UTC](https://community.plotly.com/t/pattern-matching-on-datatable-active-cell/61727/3 "2022-03-08T14:19:42Z")

</div>

Hi,  
That looks really cool.

However, I would like to change a marker (dash leaflet) with an idea to be changed. I would like to avoid remaking the whole markerlayer.

Isn’t there a way to use the row\_id and use that to change a certain object (marker) with a same id? of e.g. color?
