How to wire the Smart Action value function result to the Fields

Hello guys!

I’m trying to figure out how to wire up the Smart action values function result to a field with an Enum field

This is my prototype:

{
      name: 'Action header name',
      type: 'single',
      endpoint: 'forest/actions/smartactionname',
      fields: [{
        field: 'FieldName',
        type: 'Enum',
        enums: [],
        isRequired: true,
      },],
      values: (context) => {
        console.log(context.somedata)
        return context.somedata
      }
    },

Is there a way to wire up the data to the field?
Thanks in advance.

@Houssem_Yahiaoui

Using values: has been deprecated.

You can find more info in the release note: https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-notes-sql-mongodb/upgrade-to-v8#smart-actions

One more exemple here:

I’ve added this to the v8 upgrade and it was working like a charm, thanks @anon79585656

1 Like