getAttributesByMarker
Get all attributes of an attribute set.
Description
Fetches all attributes of an attribute set, with their data. Resolves to an array of IAttributesSetsEntity objects: the attributes themselves (marker, type, value, listTitles, validators, localizeInfos, additionalFields, …), not the attribute set entity.
.getAttributesByMarker(
,
);
Parameters schema
Schema
marker(required): string
Marker of the attribute set.
example: "productAttributes"
langCode: string
Language code. Default: the langCode passed to defineOneEntry ("en_US" if none).
example: "en_US"
Examples
Minimal example
const response = await AttributesSets.getAttributesByMarker('admins');
Example with langCode
const response = await AttributesSets.getAttributesByMarker('admins', 'en_US');
Example response
[
{
"type": "string",
"value": null,
"marker": "admin-text",
"position": 1,
"listTitles": [],
"validators": {},
"multiselect": false,
"initialValue": null,
"localizeInfos": {
"title": "Admins text"
},
"additionalFields": {}
}
]
Response schema
Schema: IAttributesSetsEntity[]
type: AttributeType
Attribute type.
example: "string"
value: unknown
Value of the attribute, normalized the same way as an entity attribute value: number | null for numeric types, the file object itself for a single-file image/file, null when the attribute carries no value.
initialValue: unknown
Initial value of the attribute.
marker: string
Marker of the attribute set.
example: "color"
position: number
Position used for sorting.
example: 1
listTitles: IListTitle[]
Options with extended data for list and radioButton attributes; empty array for other types.
example:
[
{
"title": "red",
"value": 1,
"position": 1,
"extendedValue": null,
"extendedValueType": null
},
{
"title": "yellow",
"value": 2,
"position": 2,
"extendedValue": null,
"extendedValueType": null
}
]
listTitles.title: string
Title of the list item.
example: "Item Name"
listTitles.value: number | string
Value of the list item: a number or a string.
example: 42
listTitles.position: string | number | null
Position of the list item: a number, a string, or null.
example: 1
listTitles.extended: object
Additional properties of the list item.
listTitles.extended.value: string | null
Extended value, or null.
example: "extra_value"
listTitles.extended.type: string | null
Type of the extended value, or null.
example: "color"
validators: IAttributeValidators
Validators configured for the attribute; empty object when none are set.
example:
{
"requiredValidator": {
"strict": true
},
"defaultValueValidator": {
"fieldDefaultValue": 11
}
}
validators.requiredValidator: object | boolean
Field must be filled in. Shape: { strict: boolean }.
example:
{ strict: true }
validators.trimValidator: object | boolean
Leading and trailing whitespace is stripped from the value. Stored as an empty object when the toggle is on.
example:
{}
validators.stringInspectionValidator: object
Length constraints for string fields.
example:
{ stringLength: 0, stringMin: 2, stringMax: 60 }
validators.urlInspectionValidator: object | boolean
Value must look like a URL. Stored either as true or as an object.
example:
true
validators.emailInspectionValidator: object | boolean
The value must look like an email address. Stored either as true or as an object.
example:
true
validators.checkForNumberValidator: object
The value must be a number, optionally an integer within bounds. 0 disables a bound.
example:
{ integerOnly: true, minValue: 1, maxValue: 10 }
validators.roundingNumberValidator: object
Rounds the number before storing it.
example:
{ integerOnly: false, numberOfDecimals: 2, direction: 'round' }
validators.booleanValidator: object
The value must equal one of the two declared values.
example:
{ trueValue: 1, falseValue: 0 }
validators.comparisonValidator: object
Compares the value with another attribute or with a constant.
example:
{ compareAttribute: 'notChoosed', compareValue: '10', type: 'number', operator: 'equality' }
validators.regExpValidator: object
Value must match a regular expression; invert refuses matches instead.
example:
{ patternValue: '^[0-9]{5}$', invert: false, flags: ['i'] }
validators.fieldMaskValidator: object
Value must match an input mask (9 digit, A upper letter, a lower letter, * any, $ one of ()+-).
example:
{ maskValue: '+1 (999) 999-9999' }
validators.checkForAGivenList: object
The value must be in the list, or outside it when notValue is true.
example:
{ rangeValue: ['red', 'green'], notValue: false }
validators.defaultValueValidator: object
Value used when the field is left empty.
example:
{ fieldDefaultValue: 'USD' }
validators.sizeInPixelsValidator: object
Image bounds in pixels; executed by the admin panel.
example:
{ maxX: 1920, maxY: 1080 }
validators.checkingFilesValidator: object
File size bounds and allowed extensions; run by the admin panel.
example:
{ minValue: 0, maxValue: 5, minUnits: 'kb', maxUnits: 'mb', extensions: ['pdf'] }
validators.minMaxDateValidator: object
Date bounds. The admin panel enforces them.
example:
{ minDateTimeValue: '2026-01-01', maxDateTimeValue: '2026-12-31' }
validators.valueValidator: object
The panel's "default value" control; it writes defaultValueValidator, and this name is kept because the API accepts and stores it.
example:
{ fieldDefaultValue: 'USD' }
validators.checkForLettersValidator: object
Letters-only check by pattern; run by the admin panel.
example:
{ patternValue: '^[A-Za-z ]+$' }
localizeInfos: IAttributeLocalizeInfo
Localized name of the attribute.
example:
{
"title": "My attribute"
}
additionalFields: Record<string, IAttributesSetsEntity>
Nested sub-attributes keyed by marker; an empty object when there are none.
Usage examples
Step-by-step walkthrough in the documentation:
- Get attributes by marker: retrieve the attribute schema of an attribute set by its marker.
Try it live
Run this method in the JS SDK sandbox. Connect your Project URL and App Token on first visit, then open:
- Get attributes by marker: retrieve the attribute schema of an attribute set by its marker.