You can transform and validate data with custom hooks
Pulter's Hooks help you reformat, validate, and correct data automatically via custom functions per column and/or row. For example, using these hooks you can automatically reformat area codes or country codes, remove special characters, validate emails against external data, or anything else you can think of.
Match Columns Hook
Match columns hook runs only once after column matching. They are run before the row hooks and will only run once during the import process.
A column hook receives all values in the column, formated data, and raw data. where each value is an object with index and value keys. index is the row index of the value, and value is the raw value of the column at that row, as a string.
Given the following imported data:
First Name
Last Name
Michelle
Doe
Jane
Doe
Steve
Jones
Wayne
Gretzy
Here is an example of what our match columns hook could return:
Table hook runs validation on all rows. and returns the record with new data and/or error messaging for the user.
Very expensive, but can change rows that depend on other rows. It's more advisable to use Row Hook.
The setError accepts rowIndex is the 0-indexed position of the data row, and fieldKey is the key of the field as defined by fields. messages is the message object which will be placed on the specified field.
Here is an example of what our Table hook could return: