AdapTable lets users send reports to these destinations: Excel, CSV, JSON and Clipboard.
However sometimes developers might want to add additional destinations such as particular REST endpoints, or by email. This can be done as follows:
- Add the destination to the CustomDestinations section of Export State
- Provide an implementation of the Custom Export Destination UserFunction to be called whenever that destination has been specified
- In that function to provide whatever custom code is required to send the report - the function receives the Report and the Report Data
If other information is needed you can provide custom field definitions and AdapTable will dynamically display a form accordingly and send the results in theCustomExportDestinationFunction.
In this example we have created 2 Custom Destinations - for both we simply output the report data to the console in the Custom Export Destination UserFunction handler:
- Email - which also contains Form Data and default form values
- REST Endpoint - which has no form data