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.
Output row · after the scriptsSize125.75Size unitmmItem no.SUP07-4410ColourRedRating16 · checkedCategoryLighting | LED
Action · supplier file importRow readSupplier file · row 418ReadMapped6 lines · 5 scriptsMapScripts runClean, build, look upDoneCheckedPass · writtenDoneEach script works on one value as the row passes through: cleaned, checked and written before the next row is read.
Scripts canClean valuesCheck rowsLook up codesWrite files
Read
Map
Script
Write
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.
Written for Perfion administrators, IT and product data teams · By Vipin Kumar, Founder and Solution Architect · Last updated BPAS · Exclusive Boyum Practice. India's No.1 Customer-referred Boyum IT Partner.
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
3 kinds of method a script can call on, from one-line helpers to the .NET libraryLLibrary methodsPPerfion methodsSStandard .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.
Read
An Action reads its input one input row at a time: a supplier file, a database table or data from Perfion itself.
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.
Check
The script can let the value pass, add a warning, skip the row or fail it, with a message in the $LOG.
Write
The value is written to its column in the output, ready for the next command, such as the import into Perfion.
Read, map, script, write
Actions · Supplier file import · value mappings
Stages
1 · ReadSupplier file · row 418
2 · MapName and Value derived
3 · ScriptClean, build, look up, check
4 · WriteOutput row · next command
Run log · 1,240 rows1,236 written3 warnings4 failed
Value mappings · row 418Size125.75 mm → 125.75CleanedSize unitmmSplitItem number4410 → SUP07-4410BuiltColourR → RedLooked upDescriptionAs suppliedMappedScripts on four of five lines · one value each · nothing written until the script is done
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.
Hand fixesDataFixed byWhat happenedSizes with unitsSplit by handUnits lostItem numbersPrefixed in ExcelRows missedColour codesLookup sheetOut of dateBlank ratingsNot checkedPublishedWeb imagesResized by handWrong sizesFive kinds of supplier data fixed by hand before or after import: slow, inconsistent, and found too late.
vs
Perfion ScriptingLibrary methodsNumbers split from unitsKeys built from columnsValidityWarn, skip or failA reason in the logFast lookupsBy unique keyLarge tables, quicklyEach value is cleaned, checked and converted on its way in, the same way for every row of every file.
Supplier data fixed by hand compared with Perfion Scripting, as described in Boyum IT Solutions' Perfion documentation.
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
Value mappings · one commandItem numberBuilt by scriptScriptSizeCleaned by scriptScriptDescriptionMapped as isMapColourLooked up by scriptScript
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
ParseNumber · trim methods125.75 mm125.75 + mmSplit$ 499.75 pallet499.75NumberFuel CapacityFuelCapacityTrimmedName*Of<FileNameOfFileFile name
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
Built from the input rowSUP07 + 4410SUP07-4410MakeLighting, LEDRoot|Lighting|LEDJoinText 1 emptyText 2 usedCoalesce123;456 + 789123;456;789Append
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
Rows checked as they arriveRating 16In rangePassRating 40Worth a lookWarnRating blankRow left outFail itemWrong fileRun stopsFail all
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
Lookups · conversionsAB-77-2SUP07-4410FastA-42456FastRRedFilterCable glandKabelverschraubungen → de
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
Kept while the Action runsRows counted1,240VariableRunning total₹ 4,82,000Variable$RootPathEvery sub-actionGlobalItem listHTML, row by rowTemplate
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.
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
Files, images and codeWeb images600 × 600 · webWrittenUnchanged filesSame timestampSkipped2 imagesPoint of interestSetEXECUTE.SCRIPTFiles movedCommand
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.
01
ArchitectureConcept 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.
Swipe sideways to see the full diagramRow 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.
02
Data qualityConcept 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.
Swipe sideways to see the full diagramThree 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.
03
GovernanceConcept 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.
Swipe sideways to see the full diagramFour 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.
04
ConversionConcept 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.
Swipe sideways to see the full diagramSupplier 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.
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.
Swipe sideways to see the full diagramFour 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.
01
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.
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.
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.
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.
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.
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.
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.
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.
Illustrative scenario · not a client case studyA 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
File fixing
Bad data
Website images
Before After
See which of your own hand fixes could be scripted instead.
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.
Who benefits when data is fixed on the way in: one import, three answers
One import
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.
01
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”.
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.
Perfion Scripting: questions product data teams ask
Short answers, each with a link to the part of this guide that explains it.
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.
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.
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.
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.
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.
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.
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.
See how scripts in Perfion Actions would clean, check and convert the data your own suppliers send, so it arrives ready to use. Choose the path that fits the ERP you run.