docs
  1. SCAYLE Resource Center
  2. Masterfeed Add-On
  3. Advanced field mappings

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

  1. Go to Add-Ons > Masterfeed Add-On > Feeds > Feed Configuration > Field Mapping
  2. Click on Add Field.
  3. In the column SCAYLE, select Brand from the dropdown options.
  4. In the column Feed, enter Product Brand
  5. 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 FieldDetail
Id{product.id}
IsActive{product.isActive}
IsSoldOut{product.isSoldOut}
IsNew{product.isNew}
IsAvailableextractor.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}
Categoryextractor.category concatenates all subcategory names of a product in one string
Example: Women;Women|Clothing;Women|Clothing|Pullover
HierarchicalCategoriesextractor.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
Priceextractor.price applies the following logic: gets {variant.price.withTax} value and applies extractor.round on top of it
OldPriceextractor.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
UnitPriceBaseMeasureextractor.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}
PriceRangeextractor.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 / TransformatorVariablesDetailsExample ConditionResult
list$attribute, $keyextractor.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, $indexextractor.image concatenates $cdnUrl.'/'.$product['images'][$index]['hash']
https://your-demo.cdn.csayle.com,0https://your-demo.cdn.csayle.com/23846923486334
link$attributeextractor.link supports the creation of e.g. product listing page URLshttps://your-demo.cdn.csayle.com/p/{product.productName}-{product.id}https://your-demo.cdn.csayle.com/p/heroshirt-345
replace$attribute, $find, $replaceextractor.replace replaces $find with $replace in $attribute{product.attributes.brand},bmg,Borussia MönchengladbachBorussia Mönchengladbach
ifelse$attributeextractor.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$attributeextractor.join builds a string with text and $attribute variablesWidth: {variant.width}, Height: {variant.height}Dimension = Width: 2m, Height: 50cm
split$attribute, $separator, $indexextractor.split splits $attribute among $separator and returns value with $index
{product.dimension},x,0
round$attribute, $precisionextractor.round rounds $attribute to the number of digits defined in $precision{variant.property.price.withoutTax},299,95
datetime$attributeextractor.datetime transforms date/time $attribute using the given date/time format

{product.updatedAt},U
-U transforms to 1256953732
-Y-m-d transforms to 2022-08-15

-c transforms to 2022-08-15T15:52:01+00:00
-r transforms to wed, 15 Aug 2005 15:52:01 +0000

Example: Configure a feed field with a list of category URLs

  1. Go to Add-Ons > Masterfeed Add-On > Feeds > Feed Configuration > Field Mapping
  2. Click on Add Field.
  3. In the column SCAYLE, click the Gear icon
  4. Select listExtractor from the dropdown options
  5. In Condition, enter ,categoryUrl
  6. Click SAVE.
  7. In the column Feed, enter Categories
  8. Click SAVE.

Select listExtractor

Enter Condition