Refine
Sometimes, the built-in validation is not enough. You can run your own validation logic, including async code, to enforce exactly the refinement logic you need with .refine() and .refineBatch().
Async Validator
You can also make async calls for things like database lookups, API calls, or checking external systems:
Be aware that this will run once for every cell in the column. If at all possible, prefer batch validation for expensive async work.
Batch Validation
.refineBatch() validates values from the column in batches. The function receives an array of values from the column and must return a result array of the same length. This is ideal for batching lookups that would be expensive to run for each value individually.
Suggested Fixes
Both .refine() and .refineBatch() can return a suggestedFix object. The widget presents these as one-click fixes the user can apply during the review step.