Reducing Payload Size
By default, utility hooks will not send their full schema unless the Send full schema in utility hooks
setting in the page editor is enabled. This allows the browser to send a reduced data payload resulting in faster transfer times.
Controlling Data Sent from the Browser
Often the form model contains a lot of data that does not need to be passed in Hooks. BetterForms provides two methods to control what data is passed in utility hooks.
Model Override Method
You can pass an array of paths or keys that will be applied to the form model and allow data to pass though. this allows you to pick out one or more keys to allow to pass on in the hook. The filtering follows lodash's pick
method.
ModelFilterKeys Method
By passing in a `model` key you can override the form’s data model that would normally be passed. Add a `_calc` to the model key to bind it to other model data.
Example runUtilityHook Actions
Last updated