Product Attributes
Adding a Date Attribute
Overview
Date attributes allow you to add date-related information about an item.
Prerequisites
Ensure you have administrator privileges to fabric Product Catalog. For more information, see Role-Based Access Control.
Procedure
- In the left menu, click Product > Attributes > Product. The Product Attributes page is displayed.
- Click New Attribute. The Create product attribute page is displayed. The Text attribute type is selected by default.
- Select Date.
- In the Attribute title filed, enter a name for the attribute.
- In the Select date format field, select a date format. Note that bulk import of the date attribute type uses the date format you select here. The selected 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.
- (Optional) In the Description field, enter a description for the attribute.
- In the Use JavaScript formula to calculate value field, select one of the following:
- Yes: Specifies that the value for the attribute is calculated using the JavaScript formula that you provide in the Calculation formula field. An example of a JavaScript formula is
(async () => await attribute('id') *10)()
. When you select Yes, the Calculation formula and Allow manual overwrite fields are displayed. Do the following to complete the settings:- In the Calculation formula field, enter a JavaScript formula.
- In the Allow manual overwrite field, choose one of the following:
- Yes: Specifies that you can manually overwrite the attribute value. When the Use JavaScript formula to calculate value setting is enabled, the system determines the value based on your provided formula. However, if you enable the manual overwrite option, you can replace the system-calculated value with a custom value during product attribute setup. For more information, see the Adding an Item section.
- No: Specifies that you can’t manually overwrite the attribute value. This is the default setting.
- No: Specifies that the attribute value isn’t calculated using a JavaScript formula.
- Yes: Specifies that the value for the attribute is calculated using the JavaScript formula that you provide in the Calculation formula field. An example of a JavaScript formula is
- In the Validations field, select one of the following:
- None: Specifies that no custom validation is required for the attribute. This is the default setting.
- Custom JavaScript: Specifies that the JavaScript you enter in the Validation formula field is used to validate the attribute.
The Validation formula field is displayed.
- In the Validation formula field, enter a JavaScript validation formula.
- In the Is this attribute mandatory? field, select one of the following:
- Yes: Specifies that the attribute is mandatory when creating an item.
- No: Specifies that the attribute isn’t mandatory when creating an item. This is the default selection.
- Click Save.
The date attribute with the specified settings is created.
Related Topics
Was this page helpful?