# Make a button fire different depending on view or page

**URL:** <https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336>\
**Category:** Ask the Community\
**Created:** [October 5, 2023, 2:43pm UTC](https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336 "2023-10-05T14:43:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johg\_Ananda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johg_ananda/32/13930_2.png) [@Johg\_Ananda](https://connect.superhuman.com/u/Johg_Ananda)\
**Post date:** [October 5, 2023, 2:43pm UTC](https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336/1 "2023-10-05T14:43:34Z")

</div>

Is there a way to make the button action dependent upon the view of the table, or the page of the doc, from which it is pushed?

I have a button that does great, but if its pushed on a different view I want it to do something else.

I know I can create another button, but that is not performant for this application. Thanks!

---

<div class="post-metadata">

**Author:** ![Christiaan\_Huizer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/christiaan_huizer/32/28269_2.png) [@Christiaan\_Huizer](https://connect.superhuman.com/u/Christiaan_Huizer)\
**Post date:** [October 5, 2023, 4:33pm UTC](https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336/2 "2023-10-05T16:33:08Z")

</div>

hi @Johg_Ananda

My suggestion is to work with something like tableViewName.Objectlink().contains(thisTable.Objectlink() as condition in your if statement.

Did not test it, but something like this may work

cheers, Christiaan

---

<div class="post-metadata">

**Author:** ![Johg\_Ananda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johg_ananda/32/13930_2.png) [@Johg\_Ananda](https://connect.superhuman.com/u/Johg_Ananda)\
**Post date:** [October 5, 2023, 6:43pm UTC](https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336/3 "2023-10-05T18:43:20Z")

</div>

> [@Christiaan\_Huizer](#):
>
> tableViewName.Objectlink().contains(thisTable.Objectlink()

@Christiaan_Huizer thanks for the great idea. I tried it here:

https://coda.io/embed/WO6A3M4ZIe/_susCx?viewMode=embedplay

And I can’t get it to work. [ThisTable] always refers to the parent/originating table.

Is there a formula object that gets references the current view?

---

<div class="post-metadata">

**Author:** ![Christiaan\_Huizer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/christiaan_huizer/32/28269_2.png) [@Christiaan\_Huizer](https://connect.superhuman.com/u/Christiaan_Huizer)\
**Post date:** [October 5, 2023, 7:52pm UTC](https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336/4 "2023-10-05T19:52:13Z")

</div>

@Johg_Ananda , you are right

thisTable() is indeed the main table, so the idea won’t work.

you can replace the thisTable with the hardcoded url , would that work for you?

cheers, christiaan

---

<div class="post-metadata">

**Author:** ![Johg\_Ananda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/johg_ananda/32/13930_2.png) [@Johg\_Ananda](https://connect.superhuman.com/u/Johg_Ananda)\
**Post date:** [October 6, 2023, 1:23am UTC](https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336/5 "2023-10-06T01:23:59Z")

</div>

@Christiaan_Huizer what am I comparing the hardcoded url against for the if statement?

---

<div class="post-metadata">

**Author:** ![Christiaan\_Huizer](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/christiaan_huizer/32/28269_2.png) [@Christiaan\_Huizer](https://connect.superhuman.com/u/Christiaan_Huizer)\
**Post date:** [October 6, 2023, 6:40am UTC](https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336/6 "2023-10-06T06:40:05Z")

</div>

I had a closer look, the ObjectUrl() is interesting in other context, not here.  
Maybe you can integrate the filter logic in your button to enable or disable it, thus the filter logic you may use to create a second view. However I am afraid that you need a second button. Cheers, Christiaan

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [January 4, 2024, 6:40am UTC](https://connect.superhuman.com/t/make-a-button-fire-different-depending-on-view-or-page/43336/7 "2024-01-04T06:40:21Z")

</div>

Closed on January 4, 2024, 6:40am UTC

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