Attribute Types
fabric supports the following types of attributes for storing product information:- Text: A sequence of characters. You may store any combination of text, numbers, or special characters. Text attribute has three subtypes:
- Small text: For single-line text attributes.
- Text Area: For multi-line text attributes.
- HTML: For text area attributes that support HTML.
- Number Only: An attribute type for values that are always a number.
- Date: All date-related formats. Bulk import of the date attribute uses the date format selected when the attribute was created. Once selected, the date format can’t be changed. If the format needs to be changed, you must delete the attribute and create it again using the required format.
- Boolean: A Boolean value (true/false) for a product attribute. While importing attributes from an external system, make sure the true or false values are specified for all Boolean attribute types.
- List of Values: A dropdown menu for product attributes that have defined values across the product list. Supports single selection or multiple selection from the dropdown.
- Serial: An auto increment number-type attribute. You can specify the starting number and what the increment is.
After creating a category attribute, you cannot modify its attribute type. If you want to use a different attribute type, you must create a new product attribute with the required type.
Calculation Formulas
Businesses often require dynamically calculated attributes based on existing values. For example:- You can configure a product’s display name to be Product Name + by + Brand Name, Instead of naming each product or variant individually. This formula automatically creates names for the products.
- The area of a rug can be calculated by multiplying width with length and the price per square foot can be calculated by dividing the price attribute value by the area attribute value.
- You can calculate weight per count by dividing the weight of the product by the total count of items inside the box.
Note that the values in double quotes (
" ") represent the title of the reference attribute and refer to the absolute value of the attribute being used for calculation.
Validation Formulas
you can specify business validations on attributes using a low-code JavaScript formula and ensure data integrity and quality. This operation doesn’t manipulate data, only validates fields for the attributes.
Formulas are based on JavaScript syntax, so you can use all inbuilt JavaScript functions.
For example, values given as a string can be stored as integers by using formulas such as
(async () => parseFloat(await attribute('Height (in)')) - parseFloat(await attribute('Weight (in)')) )().
