2024-11-28 - Finding value in attribute tree
Jump to navigation
Jump to search
NPM module - Izara Core - Attribute Tree Service - Product Attributes Service - Sell Offer Terms
Overview
How to find the value for one topLevelParentId (eg Product or SellOffer), for a labelId.
If the topLevelParentId links to multiple attribute nodes of the requested labelId one value will be returned (not defined which). If want to find all matching values can do a SearchResult that skip the random sortFields
Base SortResult request
- objType: attribute
- translate element that connects attribute > attributeLink
- filter attributeLink.topLevelParentIdentifiers
- AND translate element that connects attribute > attributeLabel
- filter attributeLabel.labelId
- above complexFilter will pass to searchResult all attributes for requested labelId and topLevelParentId, might be multiple
- requiredData: linkPath for translation.text
- sortFields: random(?)
LinkPath
- field: translation.text
- LinkStep 1: to translationLink
- currentLink relationship
- aggregate=true
- complexFilter for requested languages
- sortFields: array of languages in order of priority
- LinkStep 2: to translation
- is toOne, so no aggregate/combine needed
After base SortResult complete
- aggregate minimum, this is to get one random attribute's translation text