Item attributes are used to define product characteristics. For example, a product name, an identity number, and a product description are all common attributes of a product.
Attributes are key-value pairs, such as Color: red, that hold information for each property of the product.
fabric supports the following types of attributes for storing product information:
The following table shows the attribute types and their properties. This will help you determine the mandatory and optional properties of an attribute type. To ensure data quality, set up one or more validations based on the selected attribute type.
Attributes | Text | Number Only | Date | Boolean | List of Values | Serial |
---|---|---|---|---|---|---|
Attribute title | Required | Required | Required | Required | Required | Required |
Description | Optional | Optional | Optional | Optional | Optional | Optional |
Use JavaScript to calculate value | Optional | Optional | Optional | Optional | Optional | N/A |
Validations | Optional | Optional | Optional | Optional | Optional | N/A |
Is this attribute mandatory? | Required | Required | Required | Required | Required | Required |
Type of text | Required | N/A | N/A | N/A | N/A | N/A |
Date Format | N/A | N/A | Required | N/A | N/A | N/A |
Decimal | N/A | Optional | N/A | N/A | N/A | N/A |
Type of list | N/A | N/A | N/A | N/A | Required | N/A |
Businesses often require dynamically calculated attributes based on existing values. For example:
With low-code JavaScript formulas, these attribute values can be calculated automatically. Here are some frequently used formulas:
Operation | Calculation Formula |
---|---|
Divide | (async ()=> await attribute('attribute 1 ID') / await attribute('volume'))() |
Multiply | (async ()=> await attribute('attribute ID') \* 10)() |
Sum | (async ()=> await attribute('attribute 1 ID') + await attribute('attribute 2 ID'))() |
Subtract | (async ()=> await attribute('attribute 1 ID') - await attribute('attribute 2 ID'))() |
Concatenate | (async ()=> await attribute('attribute 1 ID') + " followed by " + await attribute('attribute 2 ID'))() |
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.
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.
Validation Type | Validation Formula |
---|---|
Number Validation | (async ()=> await attribute() >=0 && await attribute()<=20 && await attribute()%0.25 === 0)() |
String Validation | (async ()=> (await attribute()).length < 200)() |
Date (Greater than Equal to current Date) | (async ()=> await attribute() >= new Date())() |
Date (Greater than Equal to particular Date) | (async ()=> await attribute() >= new Date('02/14/2021'))() |
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)')) )()
.
Item attributes are used to define product characteristics. For example, a product name, an identity number, and a product description are all common attributes of a product.
Attributes are key-value pairs, such as Color: red, that hold information for each property of the product.
fabric supports the following types of attributes for storing product information:
The following table shows the attribute types and their properties. This will help you determine the mandatory and optional properties of an attribute type. To ensure data quality, set up one or more validations based on the selected attribute type.
Attributes | Text | Number Only | Date | Boolean | List of Values | Serial |
---|---|---|---|---|---|---|
Attribute title | Required | Required | Required | Required | Required | Required |
Description | Optional | Optional | Optional | Optional | Optional | Optional |
Use JavaScript to calculate value | Optional | Optional | Optional | Optional | Optional | N/A |
Validations | Optional | Optional | Optional | Optional | Optional | N/A |
Is this attribute mandatory? | Required | Required | Required | Required | Required | Required |
Type of text | Required | N/A | N/A | N/A | N/A | N/A |
Date Format | N/A | N/A | Required | N/A | N/A | N/A |
Decimal | N/A | Optional | N/A | N/A | N/A | N/A |
Type of list | N/A | N/A | N/A | N/A | Required | N/A |
Businesses often require dynamically calculated attributes based on existing values. For example:
With low-code JavaScript formulas, these attribute values can be calculated automatically. Here are some frequently used formulas:
Operation | Calculation Formula |
---|---|
Divide | (async ()=> await attribute('attribute 1 ID') / await attribute('volume'))() |
Multiply | (async ()=> await attribute('attribute ID') \* 10)() |
Sum | (async ()=> await attribute('attribute 1 ID') + await attribute('attribute 2 ID'))() |
Subtract | (async ()=> await attribute('attribute 1 ID') - await attribute('attribute 2 ID'))() |
Concatenate | (async ()=> await attribute('attribute 1 ID') + " followed by " + await attribute('attribute 2 ID'))() |
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.
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.
Validation Type | Validation Formula |
---|---|
Number Validation | (async ()=> await attribute() >=0 && await attribute()<=20 && await attribute()%0.25 === 0)() |
String Validation | (async ()=> (await attribute()).length < 200)() |
Date (Greater than Equal to current Date) | (async ()=> await attribute() >= new Date())() |
Date (Greater than Equal to particular Date) | (async ()=> await attribute() >= new Date('02/14/2021'))() |
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)')) )()
.