Using the data transformation block inspired from Excel, using a domain-specific language (DSL) can seem difficult. To help you understand how to make better use of the functions, we've listed below the main use cases, functions associated with them, and which formulas to write to achieve the use case mapping goal.
Attribute Types (from target examples) |
Common Applicable Attributes |
Primary Function |
Example Formula |
Description |
---|---|---|---|---|
Text | Title, Description | Concatenate | CONCATENATE("<p><b>Produktbeschreibung</b></p><p>",description,"</p><p><b>Technische Details</b>",technicality,"</p><p><b>Lieferumfang</b>",shipment) | This function takes the mapped attributes, and combines them into a single output with html tags. |
Array of Strings | Product Options, Product Features | Split, Regexreplace | SPLIT(REGEXREPLACE(Amazon_Feed_product_type, "toiletseat", "24385"), "#&@!") | This function splits the Amazon Feed product type by the "#&@!" value then replaces the occurances of "toiletseat" with "24385" |
Text | Title,Bullet Points, Images | IFS, Left, Concatenate | IFS(title_maison_du_monde!="", LEFT(title_maison_du_monde, 70), title_maison_du_monde="", LEFT(CONCATENATE(name, " ", color), 70)) | If the first title value is blank, select the second and concatenate 3 values, for either start from 70 characters to the left |
Measurement | Any Measurement this is required | Measurement | MEASUREMENT(PACKAGE_WEIGHT,'POUND') | This assigns PACKAGE_WEIGHT as the value and POUND as the unit to be consolidated into the Package Weight Amazon (any marketplace) attribute |
Links (URL) | Images, any attribute stored as an array | IFS, ArrayElement | IFS(ARRAYELEMENT(hardgood,1) = null, ARRAYELEMENT(softgood,1), ARRAYELEMENT(hardgood,1)!=null,ARRAYELEMENT(hardgood,1)) | This checks if there is a value in hardgood array index 1, if there isn't it sends softgood array index 1, otherwise it sends hardgood array index 1. NOTE: null and "" are pretty interchangable |
Measurement | Measurement attributes | Measurement, Round | MEASUREMENT(ROUND(net_weight, 2), "KILOGRAM") | This assigns net_weight as the value and KILOGRAM, and sends the value with two decimals rounded |
Text | Bullets, Description | Clean HTML | CLEANHTML(CONCATENATE(benefit_title_1, ' ',benefit_description_1)) | This concatenates the two attributes and removes any HTML tags present to prep for display on the detail page |
Text | Material related flags (contains xyz etc.) | TOTEXT | TOTEXT(contains_wood_ | This converts the attribute into a string value, in this example they were transforming a boolean. |