Skip to main content

BPAS

Perfion PIM · Complete Feature Guide

Scripting Perfion Data Scripting Guide

Add a few lines of code where Perfion’s standard Actions stop: clean, check, build and look up each value as data arrives, in plain sight on the line it affects.

Perfion scripting adds a few lines of C# to an Action where its standard commands stop. A script sits on one value mapping and works on one Value and Name at a time, as each input row passes through: cleaning the value, checking it, building it from other columns or looking it up elsewhere. A script library of ready-made methods handles the common jobs, and the EXECUTE.SCRIPT command runs code of its own, for work such as moving files after an image import.

At a glance

Perfion name
Scripts on value mappings, the script library and the EXECUTE.SCRIPT command
Where
Inside Perfion Actions: on a line of a value mapping, or as a command of its ownValue mapping scriptsEXECUTE.SCRIPTScript libraryC# code, run for one value at a time
Used by
Perfion administrators and IT write the scripts; product data teams get clean, checked dataNo separate program: the Action does the rest
Kinds of method
3 kinds of method a script can call on, from one-line helpers to the .NET libraryLibrary methodsPerfion methodsStandard .NET
How It Works

How Perfion Scripting works, from an input row to a clean, checked value

An Action reads its input one row at a time; each value mapping derives a value, and a script on that line can clean, build, look up or check it before it is written.

  1. Read

    An Action reads its input one input row at a time: a supplier file, a database table or data from Perfion itself.

  2. Map

    For each row, every value mapping in turn derives a Name and Value for the output.

  3. Script

    Where a line has a script, it runs now, before anything is written, and can test and change both the value and the column it goes to.

  4. Check

    The script can let the value pass, add a warning, skip the row or fail it, with a message in the $LOG.

  5. Write

    The value is written to its column in the output, ready for the next command, such as the import into Perfion.

An illustration, not a screenshot: scripts cleaning, building and converting values on the lines of an import Action.
Hand fixes vs Perfion Scripting

Hand fixes vs Perfion Scripting: what changes when data is fixed on the way in

Hand fixes are slow, done differently each time, and often come after the damage. Perfion scripting fixes and checks each value as it arrives, the same way for every row.

Supplier data fixed by hand compared with Perfion Scripting, as described in Boyum IT Solutions' Perfion documentation.
Data Hand fixes Perfion Scripting
Sizes with units, such as 125.75 mm Split by hand, cell by cell. Split into a number and a unit by ParseNumber.
Required values that are missing Found after publishing. The row is left out, with a reason in the $LOG.
Numbers out of range Spotted by a reviewer, if at all. Checked on every row, then warned or failed.
Item numbers that clash between suppliers Prefixed by hand in a spreadsheet. Built from the supplier ID and item number on import.
Supplier codes, such as R, G and B Converted with a lookup sheet. Converted by a fast lookup on a shared table.
Counts and running totals Worked out in a separate sheet. Kept in a named variable during the run.
Features for a new kind of data Worked out column by column. Suggested by Perfion from the data, for review.
Images for a website Resized and renamed by hand. Written in the size and format needed, only when changed.

See which of your own hand fixes could be scripted instead.

See it for your business
Capabilities in Depth

Perfion Scripting capabilities: eight ways scripts shape data on the way in

Each capability shows what it does in Perfion, and what it is worth to the business.

Operational Reality (Capabilities)

A script sits on one value mapping of an Action and is part of it. As the Action reads its input one row at a time, each value mapping derives a Name and Value; the script runs right after that and right before the value is written to the output, so it can test and change both. Perfion compiles the script into a method automatically. Scripts are written in C# and can use some, not all, of the .NET library, and Boyum’s advice is to keep each one simple and focused on the task at hand.

  • Part of the value mapping
  • Runs before the value is written
  • C# with parts of .NET

Executive ROI Value

Every script is in plain sight, on the line it affects, so anyone can see where custom logic exists and what it changes.

  • Visible
  • Focused

Operational Reality (Capabilities)

Supplier files often pack numbers together with units or signs in one cell, such as “125.75 mm”. ParseNumber reads such a value until it finds a number, and returns the number together with what comes before and after it, so the number and its unit can go to separate columns. Trim methods take all whitespace out of a value or a column name, and another removes the characters that are not valid in file names.

  • Numbers split from units and signs
  • Whitespace trimmed out
  • Valid file names

Executive ROI Value

Values arrive in Perfion as clean numbers and names, without a round of cell-by-cell fixing before every import.

  • Clean
  • Repeatable

Operational Reality (Capabilities)

A script can read any column of the current input row, not only its own. That makes compound values simple, such as an item number prefixed with the supplier ID, so that items from several suppliers never clash. Make builds a value from fixed text, input-row columns and variables; Join links parts with a separator, such as a category path; Coalesce takes the first part that has a value, with backups if the first is empty; and AppendOutValue gathers the values of rows merged on the same key into one list.

  • Any column of the input row
  • Templates, joins and fallbacks
  • Merged rows in one list

Executive ROI Value

Keys, paths and descriptions come out right first time, built the same way for every row and every file.

  • Consistent
  • Unique keys

Operational Reality (Capabilities)

Scripts can check that required fields have values, that numbers are within a required range, and that file paths exist and contain the files they should. Each check gives a value a validity: pass; warn, which adds a warning to the $LOG; fail the item, which leaves the row out and writes a notice to the log; or fail all, which stops all processing after the current command. Skipped rows have a status of their own, so they are easy to tell apart from failures.

  • Required values and ranges
  • Files that must exist
  • Reasons written to the log

Executive ROI Value

Bad rows are kept out of the product record, and every one leaves a reason that someone can act on.

  • Safe imports
  • Traceable

Operational Reality (Capabilities)

Scripts convert values using lookup data, such as supplier item numbers into your own, or codes such as R, G and B into colour names. A fast lookup finds a row by its unique key and is built for large tables. A flexible lookup accepts any filter expression, similar to SQL, but Boyum notes it can be very slow on a large table. Perfion.Translate translates a value from one language to another, named by ISO 639-1 code.

  • Fast lookups by unique key
  • Flexible lookups by filter
  • Translation between languages

Executive ROI Value

Codes and references from every supplier arrive in your own terms, without a lookup sheet kept on the side.

  • Converted
  • Fast

Operational Reality (Capabilities)

A named variable keeps a value beyond one script, to count, total or collect information while an input source is processed, such as a running balance of prices. By default it lives within the current command; when its name starts with $ it becomes global, available everywhere in the running Action, including sub-actions. Scripts can also read, create and change whole data sources, fill a template once for every row to build an HTML list, and merge several data sources into one XML document.

  • Counts, totals and running balances
  • Global across sub-actions with $
  • Lists and XML from data sources

Executive ROI Value

Summaries, counts and lists are produced as part of the run, not rebuilt afterwards in a spreadsheet.

  • Summaries
  • Shared

Operational Reality (Capabilities)

Perfion methods let a script work with Perfion itself. One finds a feature by name or ID and reports its data type and whether it is localizable, selectable, multi-valued or remote, so an Action can act on what it finds. Another analyses an input data source and suggests the features needed before it can be imported, as selectable, multi-valued, hierarchical or by data type; it does not create them. A third analyses the items of a base feature in the Perfion database and creates a configuration from the data it finds, which Boyum notes can save many hours of manual configuration work.

  • Feature details on request
  • Suggested features for new data
  • Configurations built from data

Executive ROI Value

New product ranges and supplier files are modelled faster, with Perfion drafting the first version from the data itself.

  • Faster set-up
  • Data-led

Operational Reality (Capabilities)

Perfion.WriteFile writes files and images stored in Perfion to files, and for images can resize them, change their format and fit or crop them, with the same image handling as the Media Server. It writes a file again only if its timestamp has changed, and can write several files from a multi-valued feature. Another method sets the point of interest of images. The EXECUTE.SCRIPT command runs C# code of its own, for example to move or remove files after an import of images, upload or download files from an FTP server, or start an external application. Where the standard .NET classes are not enough, an external library can be added.

  • Images written only when changed
  • Code of its own as a command
  • .NET Framework 4.8 libraries

Executive ROI Value

Website images, file housekeeping and the odd one-off job are handled inside Perfion, in the same Actions as the data.

  • Automated
  • In one place
Core Concepts

5 Core Concepts of Perfion Scripting

The first explains how scripts are placed, and the second where cleaning belongs. The third makes bad rows visible, the fourth converts values reliably, and the last keeps scripts small and maintainable.

  1. Concept 01 · Small scripts in a fixed place

    Solve One Value at a Time

    The product data problem it solves

    A supplier import is handed to an outside developer as a custom program. It works until a column changes. Nobody in the team can see where the logic is or which values it touches, so every change waits for the developer.

    The concept explained

    Perfion scripting is built so that nobody has to write a program. The Action already reads the input, one input row at a time, and works through each value mapping in turn. A script is placed on one of those lines and deals with one Name and Value only. It is clear whether a script exists, exactly where it is and what it affects, and, as Boyum puts it, you only need to focus on resolving a single value at a time.

    Everyday analogy

    A quality checkpoint on a packing line: one inspector at one station, checking one thing, while the line does the rest.

    In Perfion

    The script runs after the value mapping has derived the Name and Value, and before the value is written to the output column. It can also read the value already in the output row, the number of the current input row, and what was entered in the mapping’s From and To fields.

    BPAS method · toolDeploy EnterpriseDesign before configurationThe data model is designed and signed off before anything is configured: the Design phase of toolDeploy Enterprise.
    Solve one value at a timeLeft: input row 418 of a supplier file holds size 125.75 mm, supplier SUP07 and colour R. Middle: the value mapping for size derives the name Size and the value 125.75 mm, and the script on that line runs here, before anything is written. Right: the output row receives Size as the number 125.75, and the next line is processed. Bottom: one line, one Name, one Value; it is clear where each script is and exactly what it changes.Small scripts in a fixed placeInput row 418supplier fileSize · 125.75 mmSupplier · SUP07Colour · RValue mappingthe Size lineName · SizeValue · 125.75 mmScript runs hereOutput rowwritten after the scriptSize · 125.75A number, not textThen the next lineOne line, one Name, one ValueIt is clear where each script is, and exactly what it changes.
    Row 418 of a supplier file enters the value mapping; the Size line derives the name Size and the value 125.75 mm; the script on that line runs before anything is written; the output row receives the number 125.75.
  2. Concept 02 · Fixed once, on the way in

    Clean Data on the Way In, Not After

    The product data problem it solves

    Every supplier price list is opened in a spreadsheet and fixed by hand before import: units split from sizes, spaces taken out, file names corrected. It takes days every month, and the next file from the same supplier needs exactly the same work.

    The concept explained

    Data from outside is rarely clean. Numbers come with units, signs or text in the same cell, names carry spaces, and file names carry characters that are not valid. A script on the import Action fixes these as each row arrives: ParseNumber separates the number from what surrounds it, and trim methods tidy names and values. The fix is written once and applied the same way to every row of every future file of the same shape.

    Everyday analogy

    Washing vegetables at the kitchen door, before they reach the cooks, rather than picking grit out of every plate.

    In Perfion

    ParseNumber returns the number it finds, if any, with the text before and after it, so “$ 499.75 pallet” gives 499.75, the currency sign and the unit. Number formats differ between countries, and the method can be told which format to read.

    Clean data on the way in, not afterLeft: three values as received from a supplier: 125.75 mm, $ 499.75 pallet and Fuel Capacity. Middle: the library method used on each: ParseNumber, ParseNumber and Trim. Right: the clean output: the number 125.75 with the unit mm kept separately; 499.75 with the dollar sign and pallet kept separately; and FuelCapacity with the space taken out. Bottom: fixed once, on the way in; every future file of the same shape is cleaned the same way.Fixed once, on the way inSupplier fileas receivedLibrary methodon the import lineClean outputready for Perfion125.75 mmParseNumber125.75 · unit mm$ 499.75 palletParseNumber499.75 · $ · palletFuel CapacityTrimFuelCapacityWritten once, applied to every rowEvery future file of the same shape is cleaned the same way.
    Three values as received, 125.75 mm, $ 499.75 pallet and Fuel Capacity, pass through ParseNumber, ParseNumber and Trim, and come out as 125.75 with the unit mm, 499.75 with $ and pallet, and FuelCapacity.
  3. Concept 03 · Every rejected row has a reason

    Let Bad Rows Fail Loudly

    The product data problem it solves

    A supplier file with blank current ratings is imported without complaint. Two weeks later a contractor orders a breaker from the website on the strength of an empty field, and only then does the team find 140 items with no rating.

    The concept explained

    A check that fails silently is worse than no check. Scripts give each value a validity that matches the risk: a warning for something worth a look, a failed item for a row that must not be imported, and a failed run when the whole input is wrong. Each writes a message to the $LOG that says what was wrong, so a rejected row becomes a task for someone, not a mystery.

    Everyday analogy

    A goods inward clerk who rejects a damaged carton and writes the reason on the delivery note, rather than quietly sending it back.

    In Perfion

    A failed item leaves its row out of the output. A failed run stops all processing after the current command, and no output is created. Skipped rows are logged with a status of their own, so they are easy to tell from real failures.

    Let bad rows fail loudlyLeft: four rows checked as they arrive. Row 12, rating 16, passes. Row 37, rating 40, passes with a warning. Row 58, a discontinued item, is skipped. Row 91, with a blank rating, fails and is left out. Right: the log records the warning for row 37, the skip for row 58 and the failure for row 91, each with its reason. Bottom: a failed run stops all processing after the current command and creates no output; every rejected row has a reason.Every rejected row has a reasonRows checked$LOGRow 12 · rating 16PassRow 37 · rating 40WarnWarn · row 37 · rating 40 highRow 58 · discontinuedSkipSkip · row 58 · discontinuedRow 91 · rating blankFail itemFail · row 91 · rating requiredFail all: the run stops after the current commandNo output is created, and the reason is written to the log.
    Four rows are checked: rating 16 passes; rating 40 passes with a warning; a discontinued row is skipped; a blank rating fails the row. Each warning, skip and failure is written to the log with its reason.
  4. Concept 04 · One table, not a lookup per file

    Convert with a Lookup, Not by Hand

    The product data problem it solves

    Each supplier uses its own item numbers and colour codes. A catalogue executive keeps a lookup sheet, runs it against every file, and misses the rows added since the sheet was last updated.

    The concept explained

    When values must be converted, the conversion belongs in a table, not in someone’s head. A lookup data source holds the mapping, such as supplier item numbers against your own, and a script on the import line looks up each value as it passes. A fast lookup finds the row by its unique key and stays fast on large tables. A flexible lookup can use any filter, but can be very slow on a large table, so it suits short lists such as colour codes.

    Everyday analogy

    A PIN code directory at the post office: the clerk looks up each address as the letter arrives, instead of remembering every PIN code.

    In Perfion

    A fast lookup needs a table data source with a unique key as its first column, such as the output of the SELECT.UNIQUE command. One form returns the whole row; the other returns a single value and does not fail if the column does not exist.

    Convert with a lookup, not by handLeft: supplier item numbers AB-77-2, AB-77-3 and ZX-10 arrive in the import. Middle: a fast lookup finds each by its unique key in a lookup table of 9,000 rows. Right: AB-77-2 becomes SUP07-4410 and AB-77-3 becomes SUP07-4411; ZX-10 has no match and is kept as it is. Bottom: fast lookups by unique key for large tables; flexible filter lookups for short lists such as colour codes.One table, not a lookup per fileSupplier item no.as receivedFast lookupunique key · 9,000 rowsYour item no.written to the outputAB-77-2Key foundSUP07-4410AB-77-3Key foundSUP07-4411ZX-10No matchKept as ZX-10Fast lookups for large tablesFlexible filter lookups are kept for short lists, such as colour codes.
    Supplier item numbers AB-77-2 and AB-77-3 are found by unique key in a lookup table of 9,000 rows and become SUP07-4410 and SUP07-4411; ZX-10 has no match and is kept as it is.
  5. Concept 05 · Small, readable, shared

    Reach for the Library Before Writing Code

    The product data problem it solves

    Over two years, the team’s import scripts grow into long blocks of custom code. Each does the same few jobs a little differently, and nobody wants to change one in case it breaks.

    The concept explained

    Most scripting jobs come up again and again: cleaning a number, building a value from several columns, looking something up, checking a range. The script library covers them with ready-made methods, often in one line, and Perfion methods cover work with Perfion itself. Standard .NET classes come next, and an external library last. Boyum’s advice is plain: keep the task at hand simple and focused, and do not go further into .NET code than it needs just because you can.

    Everyday analogy

    A toolbox on the shop floor: reach for the spanner that fits before machining a new one.

    In Perfion

    Boyum invites ideas for new library methods, for example where the same three lines of code are written every time. Added libraries must be compatible with .NET Framework 4.8 and cannot use the namespaces Pim. or Perfion.

    From BPAS · prodRecord newsletterprodRecordKeeping the record straight.One product data practice every month, written in plain English for product data teams.
    Reach for the library before writing codeFour layers, reached for in order. First, the script library: ParseNumber, Make, Join, Coalesce, Sources.Find and the Validate methods. Second, Perfion methods: Translate, GetFeatureInfo, WriteFile and CreateConfiguration. Third, standard .NET classes, some but not all, such as a check that a file exists. Last, an external library, compatible with .NET Framework 4.8. Bottom: keep the task simple and focused.Small, readable, shared1 · Script libraryParseNumber · Make · Join · Coalesce · Sources.Find · Validatefirst2 · Perfion methodsTranslate · GetFeatureInfo · WriteFile · CreateConfigurationthen3 · Standard .NETSome, not all, classes, such as a check that a file existsthen4 · External library.NET Framework 4.8 DLL · only as a last resortlastKeep the task simple and focusedBoyum’s advice: no more .NET code than the job needs.
    Four layers, reached for in order: the script library first, then Perfion methods, then standard .NET classes, and an external library only as a last resort.
Best Practices

10 Best Practices for Perfion Scripting

Each practice says what well-kept scripts look like and what it costs to ignore it. Designing scripts around your own data and suppliers is what BPAS consultants do.

  1. 01Use a library method before writing your own code

    Design · Maintainability

    The rule

    Common jobs such as cleaning numbers, building values, lookups and checks use the script library, so scripts stay short and read the same way across Actions.

    Risk if ignored

    Long blocks of custom code that do the same job a little differently in every Action.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  2. 02Keep each script to one value and one job

    Design · Scope

    The rule

    Each script deals with the value on its own line and does one thing, as Boyum advises, with a separate line for each further output, such as a unit split from a size.

    Risk if ignored

    Scripts that quietly change several things at once, which nobody dares to edit.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  3. 03Allow for empty values before converting them

    Reliability · Values

    The rule

    Scripts that convert or calculate first allow for an empty value, as Boyum’s own examples do, so a blank cell is handled rather than failing the run.

    Risk if ignored

    Runs that stop at the first blank cell, or blanks turned silently into numbers.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  4. 04Match each check to the risk: warn, skip or fail

    Governance · Validation

    The rule

    Each check has an agreed result: a warning for values worth a look, a skipped row for rows that are meant to be left out, a failed row for data that must not be imported, and a failed run only when the whole input is wrong.

    Risk if ignored

    Every problem treated as fatal, so imports never finish; or nothing treated as fatal, so bad rows go live.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  5. 05Write messages that say what failed, and why

    Governance · Logs

    The rule

    Every warning and failure carries a message that names the field, the value and the rule broken, such as a rating out of range, so the log can be worked through without opening the script.

    Risk if ignored

    A log full of “error” lines that only the script’s author can explain.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  6. 06Use fast lookups for large tables

    Performance · Lookups

    The rule

    Lookups on large tables, such as item numbers, use a unique key and the fast lookup methods; flexible filter lookups are kept for short lists.

    Risk if ignored

    Imports that crawl because every row filters a table of thousands, which Boyum warns can be very slow.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  7. 07Make a variable global only when another command needs it

    Design · Variables

    The rule

    Named variables stay within their command unless another command or sub-action needs them, and the global names in each Action are known and documented.

    Risk if ignored

    Values from one part of an Action turning up in another, and totals nobody can trace.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  8. 08Review suggested features before they are created

    Data model · Set-up

    The rule

    Features that Perfion suggests from a new data file are checked, and adjusted where needed, by the person who owns the data model before any of them are created.

    Risk if ignored

    Features created straight from one supplier’s spreadsheet, with its names and quirks built into the data model.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  9. 09Keep connection details out of script code

    Security · Connections

    The rule

    Scripts refer to connections by name, through the system variables available from Perfion 2024-R1, rather than holding server names and passwords in the code.

    Risk if ignored

    Passwords readable in every script, and scripts that break the day a server moves.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
  10. 10Add outside libraries only when needed, and keep a record

    Upgrades · Libraries

    The rule

    An external library is added only where the script library and standard .NET classes cannot do the job; it is compatible with .NET Framework 4.8, arrives with any libraries it depends on, and is recorded against the scripts that use it.

    Risk if ignored

    Scripts that stop working because a library, or one it depends on, was never added on another server.

    Get it right with BPAS

    Not sure this is in place for your scripts? Talk to a BPAS consultant.

    Talk to BPAS
Self-Audit · 10 Best Practices

Perfion Scripting self-audit: how many are in place today?

Tick each of the ten practices above that your business already follows. Your score updates as you go.

Practices in place
0 of 10

Tick the practices that are in place.

Book a Perfion Scripting review

Nothing you tick is stored or sent.

Illustrative scenario · not a client case study A Business Like Yours

Illustrative scenario: an Indian electrical products distributor, with every supplier file fixed by hand

A distributor of switchgear, cables and lighting carries about 9,000 items from 25 suppliers and sells to contractors, retailers and through its own website. Supplier price and specification files are imported into Perfion every month.

The Operational Challenge

Each supplier file is opened in a spreadsheet and fixed by hand before import. Sizes and ratings arrive as text with their units, such as “2.5 sq mm” and “16 A”. Two suppliers use the same item numbers, so the team prefixes them by hand, and colour codes are converted with a lookup sheet that is often out of date.

Blank or impossible ratings are found only after they reach the website. Product images for the website are resized and renamed by hand, in three sizes, whenever a supplier sends new ones.

  • Every file fixed in a spreadsheet
  • Item numbers prefixed by hand
  • Bad ratings found after publishing
  • Website images resized by hand

The Financial Transformation

The import Actions now carry scripts on the lines that need them. ParseNumber splits each size and rating into a number and a unit, item numbers are built from the supplier ID, and colour codes are converted by a fast lookup on one shared table.

Rows with a blank or out-of-range rating are left out with a reason in the log, and the catalogue team works through that list each month. Website images are written in the sizes needed, and only when they have changed.

  • Files imported as received
  • Item numbers built on import
  • Bad rows held back, with reasons
  • Website images written automatically
Illustrative figures for a typical Indian distributor of this size. They add up, but they are not a client case study.
Cost line Before (per month) After (per month) Difference (per year)
Fixing supplier files by hand before import₹ 70,000₹ 10,000₹ 7,20,000
Finding and correcting bad data after publishing₹ 50,000₹ 12,000₹ 4,56,000
Preparing website images by hand₹ 30,000₹ 5,000₹ 3,00,000
Total₹ 1,50,000₹ 27,000₹ 14,76,000
Illustrative saving a year₹ 14,76,000Same figures as the table, not a client result

See which of your own hand fixes could be scripted instead.

Book a Perfion Scripting review
From BPAS

prodRecord Live

Enterprise product data insights from BPAS

Keeping the record straight, live every month

prodRecord Live is a monthly webinar series on product information management, held on the second Wednesday of every month from January 2027. Each session takes one product data topic and works through it in plain English with time for your questions.

  1. Jan
  2. Feb
  3. Mar
  4. Apr
  5. May
  6. Jun
  7. Jul
  8. Aug
  9. Sep
  10. Oct
  11. Nov
  12. Dec
Explore prodRecord Live
12
Live sessions in 2027 Second Wednesday, monthly
Who Benefits

Who benefits when data is fixed on the way in: one import, three answers

  • Promoter & CXOs

    Can we trust the supplier data that reaches our catalogue and website?

    Scripts in the import check every row as it arrives, and rows that fail are held back with a reason in the log, by validity.

  • Product Data Manager

    Can my team stop fixing supplier files by hand?

    ParseNumber and other library methods clean numbers, build item numbers and convert codes during import, the same way every time.

  • Perfion Administrator & IT

    Can I handle the odd cases without a separate program?

    A script in C# handles them inside the Action, with the script library, Perfion methods and, where needed, .NET libraries.

Vocabulary

Perfion Scripting Vocabulary and Definitions

From the script, Value and Name and the input row to the script library, ParseNumber, fast lookups, named and global variables, validity and the EXECUTE.SCRIPT command. Each term shows what it means, why it matters, and a household comparison.

  1. Script

    Scripting · basics

    A few lines on one value

    Operational definition

    A few lines of C# on one value mapping of an Action. It runs for each input row and can check or change the value and the column it is written to.

    Why it matters in Perfion

    Values the standard mapping cannot handle are dealt with inside the Action, where everyone can see it.

    Everyday analogy

    A note on one line of a recipe: “if the tomatoes are sour, add a pinch of sugar”.

    See it in action:Concept 01 under Core Concepts →

  2. Value and Name

    Scripting · properties

    What is written, and where

    Operational definition

    The value a script will write, and the name of the output column it goes to. A script can test and change both.

    Why it matters in Perfion

    A script decides both what is written and which column it lands in.

    Everyday analogy

    The contents of an envelope and the address on it.

    See it in action:Concept 01 under Core Concepts →

  3. Input row

    Scripting · properties

    The row being processed

    Operational definition

    The row of input data being processed. A script can read any of its columns, not only the one on its own line.

    Why it matters in Perfion

    Values can be built from several columns, such as a supplier ID and an item number.

    Everyday analogy

    The full order slip a packer holds while packing one item from it.

    See it in action:Values built from several columns under Capabilities →

  4. Script library

    Scripting · methods

    Ready-made methods

    Operational definition

    The ready-made methods Perfion adds for scripts, such as ParseNumber, Make, Join and Sources.Find, for jobs that come up again and again.

    Why it matters in Perfion

    Common jobs take one line instead of many, written the same way every time.

    Everyday analogy

    The spice box by the stove: the usual ones within reach, ready to use.

    See it in action:Concept 05 under Core Concepts →

  5. ParseNumber

    Scripting · methods

    Numbers out of text

    Operational definition

    A library method that finds the number in a value such as “125.75 mm” and keeps what comes before and after it separately.

    Why it matters in Perfion

    Sizes, prices and weights arrive as numbers, with their units kept.

    Everyday analogy

    Reading “2 kg atta” on a bill and noting the 2 and the kg separately.

    See it in action:Concept 02 under Core Concepts →

  6. Fast lookup

    Scripting · methods

    Found by unique key

    Operational definition

    Finding a row in another table data source by its unique key, such as turning a supplier’s item number into your own. Built for large tables.

    Why it matters in Perfion

    Supplier codes are converted to your own, even across very large tables.

    Everyday analogy

    Finding a library book by its shelf number rather than reading every spine.

    See it in action:Concept 04 under Core Concepts →

  7. Named variable

    Scripting · variables

    Kept beyond one script

    Operational definition

    A value kept beyond a single script, to count, total or pass information on while an Action runs.

    Why it matters in Perfion

    Counts, totals and running balances are produced during the run.

    Everyday analogy

    The tally on a shop counter’s notepad, added to with every sale.

    See it in action:Values carried across under Capabilities →

  8. Global ($)

    Scripting · variables

    Shared across the Action

    Operational definition

    A named variable or data source whose name starts with $. It is available everywhere in the running Action, including sub-actions and the Action that started it.

    Why it matters in Perfion

    A path or a total set once is available to every command and sub-action.

    Everyday analogy

    The notice board in the staff room, rather than a note in one person’s pocket.

    See it in action:Values carried across under Capabilities →

  9. Validity

    Scripting · validation

    Pass, warn or fail

    Operational definition

    The result a script gives a value: pass, warn, fail the row, or stop the whole run, with a message in the log.

    Why it matters in Perfion

    Bad rows are kept out, and each one leaves a reason in the log.

    Everyday analogy

    The stamp at goods inward: accepted, accepted with a note, or rejected.

    See it in action:Concept 03 under Core Concepts →

  10. EXECUTE.SCRIPT

    Scripting · command

    Code as a step of its own

    Operational definition

    An Action command that runs C# code on its own, not tied to one value, for jobs such as moving files or starting another application.

    Why it matters in Perfion

    File housekeeping and other one-off jobs run inside the Action.

    Everyday analogy

    The odd-job person on the team, called in for whatever the regular roles don’t cover.

    See it in action:Files, images and code under Capabilities →

FAQ

Perfion Scripting: questions product data teams ask

Short answers, each with a link to the part of this guide that explains it.

  1. Scripting adds small pieces of C# code to Perfion Actions where the standard commands and value mappings stop. A script sits on one value mapping and works on one value at a time, to clean it, check it, build it from other columns or look it up elsewhere. The EXECUTE.SCRIPT command runs code of its own as a step in an Action.

    More on Concept 01
  2. Scripts are written in C#, so someone needs to be comfortable with a little code. But Boyum notes that you do not have to learn everything about programming: the architecture is already in place, and you only focus on resolving a single value at a time. The script library turns many common jobs into one line.

    More on Concept 05
  3. Boyum lists cleaning dirty values, such as numbers packed together with text or signs; checking that required fields have values, that numbers are within a required range and that file paths exist with the files they should contain; building compound values from several fields; converting and translating values from lookup data sources; and summarising and counting values, among many others.

    More on dirty values cleaned
  4. Yes. A script can fail an item, which leaves its row out of the output and writes a notice to the log, or fail the whole run, which stops processing after the current command. It can also add a warning, or skip a row with a status of its own, so skipped rows are easy to tell from failures.

    More on Concept 03
  5. Yes. Perfion methods can analyse a data file and suggest the features it needs before import, without creating them, and can analyse the items of a base feature and create a configuration from the data found. Another method reports a feature’s details, such as its data type and whether it is localizable.

    More on Perfion methods
  6. Scripts can use some, not all, of the standard .NET classes and methods. Other libraries, including third-party ones, can be added as DLL files, as long as they are compatible with .NET Framework 4.8 and do not use the namespaces Pim. or Perfion. Any libraries they depend on must be added too.

    More on files, images and code
  7. Scripting works the same way whichever ERP you run, because scripts run inside Perfion Actions on the data an Action reads, whether from files, databases or Perfion itself. How data moves between Perfion and your ERP is covered in its own guide.

    More on ERP integration

Still have a question?

Ask about your own products, categories and channels. A BPAS consultant will answer in plain English.

Ask BPAS