Field Validations

A company sometimes needs the content of a field to meet specific requirements. Thanks to Validations, Sales Layer allows you to establish certain rules so that each user knows how to insert data in one or more fields correctly, following the requirements assigned.

Validations work the same in all tables: products, variants, Custom Entity tables, categories, etc. when you create a single attribute inside the platform when you perform a manual import, a linked source import, or through an import via API.

You can apply more than one validation rule per field, as long as the nature of the field allows it.

Warning: It is important to consider that the number/type of validations and the number of SKUs affect performance (which can have a higher impact depending on other processes configured on the PIM).

Here are some different types of Validations available at the moment (more below):

1. Maximum number of characters in text field: it allows you to set a maximum number of characters for a text field (Name field included).

2. Required field: you can use this type of validation if you want a field to be mandatory in a form (valid in every field except Status and Tags). 

3. Range in numeric values: you can create this validation in a numeric field to define a range of accepted numeric values for the field. It applies to integers, decimals, and negatives.

To configure a validation in a product form, go to Actions, click on Redesign form, and select the Modify option of the field where you want to apply it.​​​​

 

Click on the Validations option and then choose the validations you need. Once the validations are selected, you can save them. You will see a green check if the field condition is met or a red icon if the field was filled erroneously.

By clicking on the error icon in each field, you can get more details of the error, to be able to correct it.

Example of validation in a field

If you want to delete a validation rule, leave the field empty and click on modify. If the validation has to do with the range of numbers in the validation type, you'll need to set it as None.

Additionally, you can use our filter in the platform to quickly get a list of all the items containing (or not) errors in the Validation fields, so that, you can easily review them.

See products with and without errors
Option to see products with errors in the fields

Note: Validations affect the quality report of each item. If a field is empty or marks a validation error, it will be considered as not completed in the Quality Report section.

The functionality sets the rules for the correct content in a field, but it is important to know that it will never prevent the user from saving the form. 

You can import manually, use connectors, or even export the content and use workflows in the usual way. If any imported value does not respect any existing validation, you will be able to see the error inside the form, in the platform. 

You have the option to detect the items with errors to exclude them in the export. For this, you can use our CONTAINS_ERRORS() formula and combine it with other rules, depending on your needs. For instance, you could use this formula in combination with the REMOVE_FROM_LIST formula and exclude those items with errors from the export.

Tip: This feature is included in the Enterprise/Enterprise+ accounts by default. If you want to try the functionality, do not hesitate to contact your account manager or our support team through the usual channels.

 

Unique value validation

 

When we work with specific data that cannot be duplicated such as certain codes that identify the items, this validation type can greatly help.

The unique validation can identify if a certain value in the field is applied or repeated. If the validation is activated, and there are duplicates, it will mark the field as an error, but without blocking any action in their modifications or data exporting.

This type of validation can be applied to a short text or number type of field and can be very useful to ensure unique values such as EAN values, manufacturer’s references, exclusive colors of a product, or any other identification that does not accept a duplication.

If you have this functionality active, you will be able to configure the validation from the item form by going to Actions -> Redesign form and selecting the Unique validation checkbox in the field modification option.

Warning: you can use up to two unique validations per table (2 in Products, 2 in Variants, etc.).

The validations count will be displayed in the same checkbox, where the number of used ones will be shown over the total number of available validations. If the field contains the repeated value, it will be marked with an error icon which indicates that it  doesn’t comply with the unique value as follows:  

Unique value error example
Error due to repetition of a unique value in a field

Note: The Unique Value Validation does not apply to multi-language fields even though they are accepted within the functionality.

Tip: This functionality is linked to the extended validation pack. If you need more info on the service, please, contact us through the usual channels.

 

Import validation configuration

 

If you need to export and re-import the configuration of the validations that you have in your account, you can do it in xly format.

Open the Attribute Set you want to export and click on Actions-> Redesign form and the gear symbol as shown in the screenshot below. Now select Export Configuration

Export and import configuration

Subsequently, import the xly in the same way into the attribute set/form that you wish. You can choose the fields to export or import and select only the ones you need.

In the Import settings, you will have to choose if you want to replicate the same in all forms and also if:

  • You want to merge with the existing form: this way you will update all the validations of the field, respecting the maximum number of validations allowed, but you will have to keep in mind that if a field already has a validation applied, it will be overwritten instead of added to the existing one. 
  • If you do not merge with the existing form, new attributes and their validations will be added, respecting the maximum number of validations allowed. If validation for an existing field is included in the xly, it will not be imported if the merge is inactive.
Import configuration