Access to external API from Form Designer
You can access the desired API via custom actions, which are called on a specific event, such as onClick
.
-
Adding a custom action to
FormBuilder
props:<FormBuilder
actions={{
callMyApi: ActionDefinition.functionalAction((e, args) => {
const {param1, param2, param3} = args
MyApi.call(param1, param2, param3)
}, {
param1: 'string',
param2: 'boolean',
param3: 'number'
})
}}
/> -
Adding a custom action to a component in the editor:
-
Setting the action parameters: