# Redirect to collection index page after smart action success whatever the environment and the team are

**URL:** https://community.forestadmin.com/t/redirect-to-collection-index-page-after-smart-action-success-whatever-the-environment-and-the-team-are/2895
**Category:** Help me!
**Created:** [July 13, 2021, 2:25pm UTC](https://community.forestadmin.com/t/redirect-to-collection-index-page-after-smart-action-success-whatever-the-environment-and-the-team-are/2895 "2021-07-13T14:25:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Guiguijo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guiguijo/32/2445_2.png) [@Guiguijo](https://community.forestadmin.com/u/Guiguijo)
#### Post date: [July 13, 2021, 2:25pm UTC](https://community.forestadmin.com/t/redirect-to-collection-index-page-after-smart-action-success-whatever-the-environment-and-the-team-are/2895/1 "2021-07-13T14:25:39Z")

</div>

I want to redirect the user to the collection index page after the smart action success with this:

```javascript
response.send({ success: message, redirectTo: <PATH_TO_INDEX> })

```

## Actual behavior

The correct path depends on the environment and the team of the user.

Is there any internal way to dynamically set the correct path for the redirection?

## Context

```javascript
 "meta": {
    "liana": "forest-express-mongoose",
    "liana_version": "7.8.2",
    "stack": {
      "database_type": "MongoDB",
      "engine": "nodejs",
      "engine_version": "12.22.1",
      "orm_version": "5.9.4"
    }
  }

```

---

<div class="post-metadata">

### Author: ![Sliman\_Medini](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/sliman_medini/32/19_2.png) [@Sliman\_Medini](https://community.forestadmin.com/u/Sliman_Medini)
#### Post date: [July 13, 2021, 2:36pm UTC](https://community.forestadmin.com/t/redirect-to-collection-index-page-after-smart-action-success-whatever-the-environment-and-the-team-are/2895/2 "2021-07-13T14:36:08Z")

</div>

Hi @Guiguijo,

Please have a look at [this answer to another post](https://community.forestadmin.com/t/redirecting-to-another-collection-as-a-result-of-smart-action/1769/2), I think it matches perfectly to your need.  
Let me know

Regards

---

<div class="post-metadata">

### Author: ![Guiguijo](https://dub1.discourse-cdn.com/flex013/user_avatar/community.forestadmin.com/guiguijo/32/2445_2.png) [@Guiguijo](https://community.forestadmin.com/u/Guiguijo)
#### Post date: [July 15, 2021, 12:10pm UTC](https://community.forestadmin.com/t/redirect-to-collection-index-page-after-smart-action-success-whatever-the-environment-and-the-team-are/2895/3 "2021-07-15T12:10:26Z")

</div>

thanks @Sliman_Medini
