Another way to customize those actions would be to hide the default actions by configuring the relationships as âread-onlyâ in the collection settings.
But it is not granular and you will disable both action.
Then, with both actions disabled, you would have to create a manual Smart action with a custom form to either create records or add an existing one.
This should be feasible with Smart Action Hooks, but can be a lot of work.
Iâm not sure that I get the structure of your database.
As I understand you have questions, and then, two many to many associations that link them with answers (depending on if they are required or not).
Are answers reusable between questions?
Would it be feasible to do either of those solutions:
If the answers are not reusable: replace those two relations by a single one to many relation between questions and answers, and then add a boolean column on answers depending on if they are required or not?
If the answers are reusable: replace those two relations by a single many to many relation with a ârequiredâ column on the relation table
Hey @anon39940173, thanks for your thoughtful response, because the current data model is necessary for overall application logic, I cannot change the existing relationships, and thus decided to go the âSmart Action Formâ route.
That being said, I would like to have a field be a reference to another collection, see image below:
You can change the default widget using the âwidgetâ property on the smart action form fields
{
field: "answer-type",
description: "The type of the answer.",
type: "String",
reference: "AnswerType.id",
isRequired: true,
widget: 'belongsto select'
}
Fields can also be shown / hidden dynamically using âSmart action hooksâ as per the doc.