Skip to content

Field transformations

What it is

Your products and orders often carry custom fields in Picqer or Magento: a bottle size, an "organic" flag, a country of origin. They arrive as free text, like "75 cl" or "Ja". A field transformation reads one of those fields and turns it into a clean value of a set type (text, a number, yes or no, a date) that the rest of Voorcast can use.

The main use is cost rules. A rule such as "packaging costs more per litre" needs a number to work with, and a transformation of the bottle-size field gives it one. Transformed values also show on each product's page, in the Transformed Fields card.

When you'd use it

  • You want a cost rule that depends on something only a custom field knows, such as volume, weight class or a product type.
  • A custom field is written inconsistently ("Yes", "ja", "1") and you want one clear yes-or-no value.

How to set it up

  1. Open Settings and choose Field Transformations under Data & Integrations.
  2. Pick the Product Fields or Order Fields tab, and click Add Transformation.
  3. Choose the source, Picqer or Magento. Only sources you've connected are offered.
  4. Choose the field. Voorcast lists the custom fields it found on your recent products or orders, with example values. Fields that already have a transformation are greyed out.
  5. Set the Data Type, and optionally a Transformer that cleans the value first:
    • toLitres reads volumes: "75 cl" becomes 0.75.
    • yesNoToBoolean reads yes or no in English, Dutch, German or French, as well as 1 and 0.
    • parseNumber and parsePercentage read numbers and percentages.
    • parseISODate and parseEuropeanDate read dates.
    • trimString, toLowerCase, toUpperCase and stripHTMLTags tidy text.
  6. Click Run Test to see the result on the example values, then Save Transformation.

Not sure where to start? Generate Suggestions scans your products and proposes transformations for the fields that look most useful.

Good to know

  • Only admins and owners can add, change or delete a transformation.
  • A product transformation applies to all your existing products in the background. An order transformation applies to each order the next time that order syncs, and reads order fields from Picqer.
  • When you edit a transformation you can change its type, transformer and description, but not the field it reads. To read a different field, add a new transformation.
  • If a value can't be read (a transformer that expects a number meets "n/a", say), that product is left without a value rather than given a wrong one. Check the test results for empty rows before you save.