Skip to main content

getSingleAttributeByMarkerSet

Getting one attribute with data from the attribute set.

Description​

This method return a single attribute with data from the attribute sets. It returns a Promise that resolves to an IAttributesSetsEntity object.

.getSingleAttributeByMarkerSet(

, ,

);

Parameters schema​

Schema

setMarker(required): string
Text identifier (marker) of the attribute set
example: "productAttributes"

attributeMarker(required): string
Text identifier (marker) of the attribute in the set
example: "color"

langCode: string
Language code. Default: "en_US"
example: "en_US"

Examples​

Minimal example​

const response = await AttributesSets.getSingleAttributeByMarkerSet('list1', 'list1');

Example with langCode attribute​

const response = await AttributesSets.getSingleAttributeByMarkerSet('list1', 'list1', '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", "text", "integer", "etc"

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
Textual identifier of the attribute (marker).
example: "color", "size", "etc"

position: number
Position number for sorting.
example: 1

listTitles: IListTitle[]
Array of values (with extended data) for list and radioButton attributes; empty array for non-list 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
The title or name associated with the list item.
example: "Item Name"

listTitles.value: number | string
The value of the list item, which can be either a number or a string depending on the context.
example: 42

listTitles.position: string | number | null
The position of the list item, which can be represented as a string, number, or null if not applicable.
example: 1

listTitles.extended: object
An object containing additional properties or metadata related to the list item. This could include any extra details that extend the basic information.

listTitles.extended.value: string | null
The extended value, which can be a string or null.
example: "extra_value"

listTitles.extended.type: string | null
The type of the extended value, which can be a string or null.
example: "color"

validators: IAttributeValidators
Set of validators for validation; empty object when no validators are configured.
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
Value must look like an e-mail address. Stored either as true or as an object.
example:

true

validators.checkForNumberValidator: object
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
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: '+9 (999) 999-99-99' }

validators.checkForAGivenList: object
Value must be in the list, or outside it when notValue is true.
example:

{ rangeValue: ['red', 'green'], notValue: false }

validators.defaultValueValidator: object
Value substituted 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; executed by the admin panel.
example:

{ minValue: 0, maxValue: 5, minUnits: 'kb', maxUnits: 'mb', extensions: ['pdf'] }

validators.minMaxDateValidator: object
Date bounds; executed by the admin panel.
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; executed by the admin panel.
example:

{ patternValue: '^[A-Za-z ]+$' }

localizeInfos: IAttributeLocalizeInfo
The name of the template, taking into account localization.
example:

{
"title": "My attribute"
}

additionalFields: Record<string, IAttributesSetsEntity>
Nested sub-attributes keyed by marker; empty object when none.