Skip to main content

getSingleAttributeByMarkerSet

Getting one attribute with data from the attribute set

AttributesSets.getSingleAttributeByMarkerSet(attributeMarker, setMarker, langCode)

const value = await AttributesSets.getSingleAttributeByMarkerSet('list1', 'list1')
Schema

setMarker:* number
text identifier (marker) of the attribute set
example: 'form'

attributeMarker:* string
text identifier (marker) of the attribute in the set
example: 'list1'

langCode: string
language code
example: en_US


This method return a single attribute with data from the attribute sets.

Example return:

{
"type": "list",
"marker": "list1",
"position": 192,
"validators": {
"requiredValidator": {
"strict": true
},
"defaultValueValidator": {
"fieldDefaultValue": 11
}
},
"localizeInfos": {
"title": "My attribute"
},
"listTitles": [
{
"title": "red",
"value": 1,
"position": 1,
"extended": {
"value": null,
"type": null
}
},
{
"title": "yellow",
"value": 2,
"position": 2,
"extended": {
"value": null,
"type": null
}
}
]
}
Schema

type: string
attribute type
example: list

marker: string
textual identifier of the attribute (marker)
example: list1

position: number
position number for sorting
example: 192

validators: Record<string, any>
set of validators for validation
example:

{ 
"requiredValidator": {
"strict": true
},
"defaultValueValidator": {
"fieldDefaultValue": 11
}
}

localizeInfos: Record<string, any>
localization data for the set (name)
example:

{ 
"title": "My attribute"
}

listTitles Record<string, any>
array of values (with extended data) for list and radioButton attributes
example:

[ 
{
"title": "red",
"value": 1,
"position": 1,
"extendedValue": null,
"extendedValueType": null
},
{
"title": "yellow",
"value": 2,
"position": 2,
"extendedValue": null,
"extendedValueType": null
}
]