# Link "Perspective" table dataframe input to tabulator selection

**URL:** <https://discourse.holoviz.org/t/link-perspective-table-dataframe-input-to-tabulator-selection/3695>\
**Category:** Panel\
**Tags:** perspective, tabulator\
**Created:** [May 12, 2022, 7:30am UTC](https://discourse.holoviz.org/t/link-perspective-table-dataframe-input-to-tabulator-selection/3695 "2022-05-12T07:30:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingebert](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ingebert/32/1724_2.png) [@ingebert](https://discourse.holoviz.org/u/ingebert)\
**Post date:** [May 12, 2022, 7:30am UTC](https://discourse.holoviz.org/t/link-perspective-table-dataframe-input-to-tabulator-selection/3695/1 "2022-05-12T07:30:24Z")

</div>

Hi,  
I like the Perspective Pane a lot because of its very good filter functionality.  
Now I want to link its value to a selection (for example from a tabulator table, maybe also from a plot).  
Unfortunately I can not achieve this. I tried different methods, here is a version where the selection update/callback works for tabulator but not perspective. Is there any chance or way to get this functionality? Thank you!

```auto
import pandas as pd
import panel as pn
pn.extension('tabulator','perspective')
mixed_df = pd._testing.makeMixedDataFrame()

tabulator_table = pn.widgets.Tabulator(mixed_df, selection=[])
tabulator_table_selection = pn.widgets.Tabulator(mixed_df.head(2), selection=[])
perspective_df_selection = pn.pane.Perspective(mixed_df.head(2), plugin = 'datagrid', width=1000,height = 700,toggle_config = True)

def update_selection(*events):
    tabulator_table_selection.value = tabulator_table.selected_dataframe
    perspective_df_selection.value = tabulator_table.selected_dataframe
    #Or something like this: perspective_df_selection.object = tabulator_table.selected_dataframe
    
tabulator_table.param.watch(update_selection,'selection')

pn.Column('##Select row from table:',
    tabulator_table,
    '###Tabulator table with selected values:',
    tabulator_table_selection,
    '###Perspective table with selected values (not working):',
    perspective_df_selection,
    
)

```

---

<div class="post-metadata">

**Author:** ![contango](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/contango/32/6401_2.png) [@contango](https://discourse.holoviz.org/u/contango)\
**Post date:** [November 17, 2023, 2:33pm UTC](https://discourse.holoviz.org/t/link-perspective-table-dataframe-input-to-tabulator-selection/3695/2 "2023-11-17T14:33:32Z")

</div>

Also interested in this

---

<div class="post-metadata">

**Author:** ![Marc](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/marc/32/24_2.png) [@Marc](https://discourse.holoviz.org/u/Marc)\
**Post date:** [November 19, 2023, 6:48am UTC](https://discourse.holoviz.org/t/link-perspective-table-dataframe-input-to-tabulator-selection/3695/3 "2023-11-19T06:48:11Z")

</div>

The code almost works. This issue is that `Perspective` is a _Pane_ and panes have an `object` parameter that should be set. Not a `value` parameter.

The below works.

```python
import pandas as pd
import panel as pn
pn.extension('tabulator','perspective')
mixed_df = pd._testing.makeMixedDataFrame()

tabulator_table = pn.widgets.Tabulator(mixed_df, selection=[])
tabulator_table_selection = pn.widgets.Tabulator(mixed_df.head(2), selection=[])
perspective_df_selection = pn.pane.Perspective(
    mixed_df.head(2), plugin = 'datagrid', width=500,height = 400,toggle_config = True
)

def update_selection(*events):
    tabulator_table_selection.value = tabulator_table.selected_dataframe
    perspective_df_selection.object = tabulator_table.selected_dataframe
    
tabulator_table.param.watch(update_selection,'selection')

pn.Column('## Select row from table:',
    tabulator_table,
    '### Tabulator table with selected values:',
    tabulator_table_selection,
    '### Perspective table with selected values:',
    perspective_df_selection,
    
).servable()

```

[/uploads/default/original/2X/9/9705a53d73b995c09e0d66faf7790e207ee2bd5b.mp4](https://discourse.holoviz.org/uploads/default/original/2X/9/9705a53d73b995c09e0d66faf7790e207ee2bd5b.mp4)

---

<div class="post-metadata">

**Author:** ![ingebert](https://discourse.holoviz.org/user_avatar/discourse.holoviz.org/ingebert/32/1724_2.png) [@ingebert](https://discourse.holoviz.org/u/ingebert)\
**Post date:** [November 19, 2023, 1:38pm UTC](https://discourse.holoviz.org/t/link-perspective-table-dataframe-input-to-tabulator-selection/3695/4 "2023-11-19T13:38:09Z")

</div>

Thank you for the solution, so easy! Too bad I couldn’t manage this last step on my own. 🫣 I just saw this snippet on [Linkedin](https://www.linkedin.com/feed/update/activity:7131901565459668992), makes me happy, at least it’s a nice and simple example of Panel superpower.
