Client Side Data Validators

In this section you will learn how to add client side validations to the Osmos Uploader Javascript.
Please refer to the Uploader section to learn more about client side validations and how it can be combined with dropdown to perform static or dynamic validations
You can use the Validator function on your client side Javascript code to ensure that the uploaded data is correctly formatted, mapped, and ready to use every time based on your destination's schema.
Custom validation functions can be added to the schema fields in the code snippet directly. They can be added under the validator key. They should be async functions that accept a 2D array of strings as their only argument. This corresponds to the array of all inputs for all rows + columns sent to destination.
Validation functions are called every time a user enters any input in the transform table even if the field that is being validated didn't change. This is done in order to facilitate contextual validation, where the validity of a field depends on the values of other fields.
Either ERROR or WARNING post validation checks can be added to the javascript code of a validator:
To create an error check, use aerrorMessage function
To create a warning check, use awarningMessage function
Here's an example of a validation function that checks that the value of the third column in the schema does not equal "Bob":
"name": "LastName",
"displayName": "LastName",
validator: async (rows) => {
return => {
if (row[2] === 'Bob') {
return {
errorMessage: 'Last name cannot be "Bob"'
return true;
The index passed to the row corresponds to the index in the fields array as given in the uploader snippet found on the uploader description page. As a reminder, fields array is ordered and should not be changed from the ordering given in the snippet.
Uploader snippet
Client side validation is limited to the data rendered in Osmos , which is set to 100,000 rows of data by default. Contact [email protected] if you have questions.
  • The validation functions must return an array of validation results for each row. The available validation outputs are a boolean true or false or an object with an errorMessage prop. true means that the row is valid, false means that it’s invalid with no error message, and `{ errorMessage: "custom error msg" }` is how you can provide custom error messages. They will be shown to the user when they over over the cell with error.
  • Validation functions should not reject/throw errors. We make a best-effort attempt to catch the error, and if we do we ignore the custom validation function entirely and mark all rows as valid. Please use error handling within your validation functions to ensure that they don’t throw/reject.
  • Validation functions only validate a single field, even though they are passed all columns for each row as input. If you want to validate multiple fields, add a validation function to each of the fields that you want to validate.
  • You can run any code you want in the validation function including making network requests. However, if the validation function takes a long time to run, users will be prevented from continuing on with their transformation of the data until it returns.