ALL ARTICLES
SHARE

How Fuse Delivers Back-End Validations

How Fuse Delivers Back-End Validations

In our recent blog, we covered how front-end validations help to ensure a successful data migration (via CSV or spreadsheet) to your target system, by validating the data submitted and transforming it as necessary to deliver the latter half of the ETL (Extract, Transform. Load) process. With front-end validation, you can eliminate issues before submitting your CSV for import.  But front-end validation is only half the story. Once you correct the issues discovered by front-end validation, there may still be problems that are not accounted for in the hooks set up for the front-end (see last blog for details). Without back-end validation, you may have no insights into these issues.

Fuse offers back-end validation support to ensure that, particularly after making changes to your data on submission, your customers are not left wondering what went wrong. In this article, we’ll cover how this is done.

Initializations and Hooks

In our front-end validation blog, we showed that initializations and hooks were responsible for validation, and if necessary, making small automatic transformations to your customer’s records to ensure compliance with your system. Back-end validations are handled in a similar manner but with a different type of hook. 

onSubmit (records)

While the onValidate and formatRecord hooks validate or transform the user’s data before submitting it to your system, onSubmit passes all records to your system after the user has made the necessary corrections identified by onValidate and formatRecord.

This hook requires a callback upon submission of your client’s records to your back-end by whatever means you typically would. In other words, this layer of validation is tied to your input process, we do not submit the records ourselves. The onSubmit callback allows you to pass back any back-end records for specific rows. Each record passed to the callback will have a unique identifier under the key record._meta.id.

Return Values:


No error – If there is no error, the callback will return an empty errors object, along with a message to show the user that all is well: 

Professional CSV Import Solution

Get the CEO's Take

Handpicked tech insights and trends from our CEO.

Fuse

April 21, 2023

More ideas.