Feature(s) impacted
Smart action form field when setting type “Collection”.
Observed behavior
I tried to set the id
as the value of the “Collection” form field. But it looks like I’m not doing the right thing. I also look for examples on the NodeJS agent documentation but I couldn’t find one.
{
type: 'Collection',
collectionName: 'ModelTemplateFamily',
label: 'Family',
defaultValue: async context =>
(await context.getRecord(['familyId'])).familyId,
},
Expected behavior
Fill the form “Collection” field with a default value.
Failure Logs
value?.join is not a function
TypeError: value?.join is not a function
at Function.valueToForest (/***/forest-admin-backend/node_modules/@forestadmin/agent/dist/utils/forest-schema/action-values.js:103:27)
at Function.buildFieldSchema (/***/forest-admin-backend/node_modules/@forestadmin/agent/dist/utils/forest-schema/generator-actions.js:38:48)
at /***/forest-admin-backend/node_modules/@forestadmin/agent/dist/routes/modification/action/action.js:107:69
at Array.map (<anonymous>)
at ActionRoute.handleHook (/***/forest-admin-backend/node_modules/@forestadmin/agent/dist/routes/modification/action/action.js:107:28)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Context
- Project name: Inarix
- Environment name: Development
- Agent type & version: NodeJS 1.7.1