Trouble setting Smart Actions

Hi, we are trying to setup our forest admin environment to manage the backoffice of an existing application.

So far, we deployed a prod version that is able to retrieve data from our DB, and we are trying to setup some smart actions. We followed the guidelines and added an empty action in one of our collections in the /forest folder

collection('artists', {                                                                                                                                                                                 
    actions: [{ 
    name: 'Validate Artist'

Expected behavior

According to the documentation, the smart action should be visible in the UI under the collection settings tab

Actual behavior

No smart action is displayed whatsoever.


After changing the /forest we successfully re-built our container, but still no change in the UI.
We are new to Forest Admin, and we may have some deployment issues as far as I know (for instance, I read in similar posts to check for the forestadmin-schema.json file, but I can’t manage to find it in our solution)

  • Express Version: 4.16.3
  • Sequelize Version: 5.15.1
  • Database Dialect: sql
  • Project Name: Bookunartiste

Hi @jcastagne and welcome in our community :champagne:!

I think you forgot to make your action visible :wink:, did you follow this documentation. You will see there is a step explaining how to make the action visible just after creating your action :wink:.

Another reason could be that smart action by default are of type bulk if you read the documentation of smart actions it’s written in the parameters section. So if you do not select any record the action will not be available, so if you want another type of action make sure to update the type of your action.

Hope this will help you :slightly_smiling_face:

Hi Vince, thanks for the reply!
I might have not been clear enough, actually I don’t even see the action in the settings pannel (where, from what I understand, I would have been able to make it visible)
Here is a screenshot, maybe I don’t have the proper vocabulary to explain the situation clearly :

Forest no smart action|690x354

Oh okey my bad !

So this certainly means that your schema is not up to date.
Did you restart your server after adding the action ?
You should see the new action in your .forestadmin-schema.json

Yes I did restart the server.
As I tried to explain, and I realise that might be the issue, I don’t see any .forestadmin-schema.json file. Is it something I should generate manually?

No you should not. This file is automatically generated on development environment.
Forest is expecting the first environment created to be a development environment, not a production or staging.
Did you set NODE_ENV property somewhere ? If yes what is the value ?

So I made a grep search on the whole server, I have a bunch of NODE_ENV values in node modules, apart from that I don’t see such property anywhere

Then in you .env file set NODE_ENV=development and try to restart :thinking:

Thank you so much, doing so indeed generated the schema, and I can now see my smart action :slight_smile:

1 Like