Supported Data Types

B2C Commerce script supports data types that allow you to integrate extensive functionality into your scripts.

Attributes that are queryable can be found when using Advanced Search extended attributes when searching for products in Business Manager. Whether or not the data type is queryable in Business Manager doesn't affect whether the attribute is searchable in the storefront.

B2C Commerce supports the data types listed in the following table for B2C Commerce script.

Type JavaScript Type Description Queryable in Business Manager?
String B2C Commerce script top-level String class Letters, numbers, and punctuation. Use for a word or sentence. Maximum 4000 bytes allowed. Yes
Text B2C Commerce script top-level String class Letters, numbers, and punctuation. Use for large amounts of text, such as descriptions. No
Html B2C Commerce script dw.content.MarkupText class HTML tags. This type is intended for HTML tags and values. If editing HTML attributes, Business Manager lets you edit them in an HTML editor. Editing in an HTML editor isn't possible for String or Text data types. No
Integer number A number without decimal places, such as 1, 2, 3, or 4. Attribute value range is from -2,147,483,648 to 2,147,483,647 (32bit Signed Integer) Yes
Number number Number. You can select the number of places after the decimal point by adding a scale value. If you are creating a custom attribute for a money value, use the Money data type. The Number data type only uses the values of the decimal in calculations. For example, 1/3 with 2 as the scale is processed as 0.33. If you multiply this number by 3, you see 0.99 rather than 1. In contrast, the Money data type has localized rules for rounding that cause numbers to provide totals as expected for a specific currency. Yes
Boolean boolean True or False Yes
Date B2C Commerce script top-level Date class MM/dd/yyyy Yes
Date + Time B2C Commerce script top-level Date class MM/dd/yyyy : h: mm a Yes
Image B2C Commerce script dw.content.MediaFile class An image. Merchants can select the image from the image folder structure . Developers can use a script to dynamically retrieve an image using a pipeline. No
Email string Email address. Business Manager requires the merchant to enter a valid syntax for an email address. For example, it requires a valid extension after the @ sign, among other requirements. Yes
Password string Password. This type shows a masked field and confirmation field where the merchant can enter a password. Password data type values are encrypted on export and can be encrypted for import. No
Set of String JavaScript array object containing string The attribute value is zero or more strings. Use when you want the merchant to enter one or more strings. Sets don't contain duplicates. Yes
Set of Integer JavaScript array object containing number The attribute value is zero or more integers. Use when you want the merchant to enter one or more integers. Sets don't contain duplicates. Yes
Set of Number JavaScript array object containing number The attribute value is zero or more numbers. Use when you want the merchant to enter one or more numbers. Sets don't contain duplicates. Yes
Enum of String B2C Commerce script dw.value.EnumValue class with value of type string, possibly in a JavaScript array object The attribute value is zero or more strings. Use when you want the merchant to select one or more fixed values. Select Multiple if you want more than one value associated with the attribute. Yes
Enum of Integer B2C Commerce script dw.value.EnumValue class with value of type number, possibly in a JavaScript array object The attribute value is zero or more integers. Check the Multiple checkbox if you want more than one value associated with the attribute. Yes
X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.