Advanced field mappings
In this article you will learn about advanced extraction and transformation logic that can be applied to define the fields of your feed.
The Masterfeed Add-on is based on data from the Storefront API. Thus only available for the Storefront can be included to the feed. Data that is only accessible via the Admin API can not be used for the feed generation.
Mapping Attributes
You can select all simple attribute groups to map data from SCAYLE to a corresponding field in your feed.
Example: Define attribute mapping for feed fields
- Go to
Add-Ons > Masterfeed Add-On > Feeds > Feed Configuration > Field Mapping
- Click on Add Field.
- In the column SCAYLE, select Brand from the dropdown options.
- In the column Feed, enter Product Brand
- Click SAVE.
If an attribute group is multi select only the fist attribute will be extracted for the feed field. To include more than one attribute value you can use the listExtractor.
System fields
Depending on the selected data type of your feed, you can select from a set of system fields to map data from SCAYLE to a corresponding field in your feed.
System Field | Detail |
---|---|
Id | {product.id} |
IsActive | {product.isActive} |
IsSoldOut | {product.isSoldOut} |
IsNew | {product.isNew} |
IsAvailable | extractor.productAvailability loops through all variants and applies the following logic: IF product.variant.stock.quantity > 0 OR product.variant.stock.sellableWithoutStock = true THEN true IF product.variant.stock.quantity = 0 OR product.variant.stock.sellableWithoutStock =! true THEN false |
FirstLiveAt | {product.firstLiveAt} |
CreatedAt | {product.createdAt} |
UpdatedAt | {product.updatedAt} |
IndexedAt | {product.indexedAt} |
MasterKey | {product.masterKey} |
ReferenceKey | {product.referenceKey} |
Category | extractor.category concatenates all subcategory names of a product in one stringExample: Women;Women|Clothing;Women|Clothing|Pullover |
HierarchicalCategories | extractor.hierarchicalCategories provides all subcategories of a product in an hierarchical structure, for example in JSON format:"categories": { "lvl0": [ "MEN", "WOMAN" ], "lvl1": [ "MEN > SPORTS", "WOMAN > SPORTS" ] } or in CSV format: MEN,WOMAN,MEN > SPORTS,WOMAN > SPORTS |
Id (Variant) | {variant.id} |
ReferenceKey (Variant) | {variant.referenceKey} |
FirstLiveAt (Variant) | {variant.firstLiveAt} |
UpdatedAt (Variant) | {variant.updatedAt} |
Availability (Variant) | extractor.availability applies the following logic: IF product.variant.stock.quantity > 0 THEN true IF product.variant.stock.quantity = 0 THEN false |
Price | extractor.price applies the following logic: gets {variant.price.withTax} value and applies extractor.round on top of it |
OldPrice | extractor.oldPrice applies the following logic: gets {variant.price.withTax} value and sums with all{variant.price.appliedReductions} values and applies extractor.round on top of it |
UnitPriceBaseMeasure | extractor.unitPriceBaseMeasure concatenates {variant.price.reference['size']} and {variant.price.reference['unit']} |
PriceWithTax | {variant.price.withTax} |
PriceWithoutTax | {variant.price.withoutTax} |
RecommendedRetailPrice | {variant.price.recommendedRetailPrice} |
LowestPriorPrice | {product.lowestPriorPrice.withTax} |
PriceRangeMin | {product.priceRane.min.withTax} |
PriceRangeMax | {product.priceRane.max.withTax} |
PriceRange | extractor.priceRange |
Tax | {variant.price.tax.vat.rate} |
IsSellableWithoutStock | {variant.stock.isSellableWithoutStock} |
SupplierId | {variant.stock.supplierID} |
WarehouseId | {variant.stock.warehouseID} |
Stock | {variant.stock.quantity} |
ProductId | {variant.stock.supplierID} |
Id (Category) | {category.id} |
IsHidden | {category.isHidden} |
CategoryName | {category.name} |
ParentId | {category.parentId} |
Path | {category.path} |
Slug | {category.slug} |
Extractors & Transformation Logic
Extractors and transformation logic allow for more complex use cases beyond one-to-one mappings between data from SCAYLE Storefront API to feed fields.
Extractor / Transformator | Variables | Details | Example Condition | Result |
---|---|---|---|---|
list | $attribute, $key | extractor.list returns a list of $key values | {product.category},categoryUrl | JSON:[ ["/women"], ["/women/closing"], ["/women/closing/shirts"]] CSV:"/women, /women/closing,/women/closing/shirts" |
image | $cdnUrl, $index | extractor.image concatenates $cdnUrl.'/'.$product['images'][$index]['hash'] | https://your-demo.cdn.csayle.com,0 | https://your-demo.cdn.csayle.com/23846923486334 |
link | $attribute | extractor.link supports the creation of e.g. product listing page URLs | https://your-demo.cdn.csayle.com/p/{product.productName}-{product.id} | https://your-demo.cdn.csayle.com/p/heroshirt-345 |
replace | $attribute, $find, $replace | extractor.replace replaces $find with $replace in $attribute | {product.attributes.brand},bmg,Borussia Mönchengladbach | Borussia Mönchengladbach |
ifelse | $attribute | extractor.ifelse applies an IFTTT logic with an ELSE condition in the end. The following validations can be applied: =, =!, <, <=, >=. | {variants.price.appliedreductions.category},=,sale,true,false | |
join | $attribute | extractor.join builds a string with text and $attribute variables | Width: {variant.width}, Height: {variant.height} | Dimension = Width: 2m, Height: 50cm |
split | $attribute, $separator, $index | extractor.split splits $attribute among $separator and returns value with $index | {product.dimension},x,0 | |
round | $attribute, $precision | extractor.round rounds $attribute to the number of digits defined in $precision | {variant.property.price.withoutTax},2 | 99,95 |
datetime | $attribute | extractor.datetime transforms date/time $attribute using the given date/time format | {product.updatedAt},U - |
Example: Configure a feed field with a list of category URLs
- Go to
Add-Ons > Masterfeed Add-On > Feeds > Feed Configuration > Field Mapping
- Click on Add Field.
- In the column SCAYLE, click the Gear icon
- Select listExtractor from the dropdown options
- In Condition, enter ,categoryUrl
- Click SAVE.
- In the column Feed, enter Categories
- Click SAVE.