Can't use internal redirectTo after a smart action runs successfully

In this example (https://docs.forestadmin.com/documentation/reference-guide/actions/create-and-manage-smart-actions#redirecting-to-a-different-page-on-success) you show an internal redirect on a smart action success. There might be an issue with those links though, correct me if there is a way but I will explain my use case.

The potential problem comes when you want to redirect to an entity that you newly added to your DB. As an example, let’s say I added an entity called surveys on my database in dev. Then I will deploy those changes in QA and PROD when I am ready to do so. Then, what I want to do is to redirect the user to a specific survey when I execute a particular smart action with success. But, I can’t know the URL path for each environment before I deploy, which is a problem since I don’t want to have no choice and deploy before setting the redirect. The numbers generated in the URLs seem randomly generated and they are different on each environment (’/MyProject/MyEnvironment/MyTeam/data/20/index/record/20/108/activity’). In the link showed right before the 20 is the part I am talking about.

Is there a proper way to be able to know the URLs before we deploy a DB migration in QA and PRID and if so, how do we get the right url?

Expected behavior

To be able to predict what would be a specific survey link before the table is actually created on forest.

Actual behavior

There is no way to know the url that will point to a specific entity details before that entity exists on forest

Failure Logs

None

Context

Please provide any relevant information about your setup.

Hi @FrancisRoc,
Unfortunately there is no proper way to do what you want to do today.
You’ll have to wait for the deployment in each environment to get to know the internal collection id Forest Admin uses to build the URL, and thus you’ll have to maintain a mapping between each environments and the related collection id to generate redirect urls properly according to the environment.

In the mid term we want to make urls more friendly by replacing the collection id by the collection name. You would have this url format: /MyProject/MyEnvironment/MyTeam/data/MyCollectionName/index/record/MyCollectionName/108/activity (108 being your internal record id).

I guess it would fit your needs, what do you think?

1 Like