Supported Data Types

Salesforce B2C Commerce supports the data types listed in the following table for B2C Commerce script. Attributes that are queryable can be found when using Advanced Search extended attributes when searching for products in Business Manager. This doesn't affect whether the attribute is searchable in the storefront.

For more information about defining custom attributes, see the Custom Attribute Definition Details Page.

Type JavaScript Type Description Queryable in Business Manager?
String B2C Commerce script top level String class Letters, numbers, and punctuation. Usually, this is a word or sentence. Yes
Text B2C Commerce script top level String class Letters, numbers, and punctuation. This is intended for larger amounts of text, such as descriptions. No
Html B2C Commerce script dw.content.MarkupText class HTML tags. This is intended for HTML tags and values. If editing HTML attributes, Business Manager lets you edit them in an HTML editor, whereas this isn't possible for String or Text data types. No
Integer number A number without decimal places, such as 1, 2, 3, or 4. 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 .33. If you multiply this number by 3, you see .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 this 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 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. This is used 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. This is used 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. This is used 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, mightbe in a JavaScript array object The attribute value is zero or more strings. This is used 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, mightbe 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

Related Links

Supported Data Types for Search and Sorting Rules

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. By continuing to use this site you are giving us your consent to do this.