With a few exceptions, the core is always a JavaScript function called transform which contains the dataset to be transformed as its first parameter. The corresponding data structure is explained in the respective sections. Where relevant, further parameters such as the filename are also provided.
/**
function transform (data, filename, extra) {
return []
}
Included Libraries
Additionally, various external tools are integrated and can be used in the transformation codes:
dayjsxmlParserxmlParser4xmlParser4SFTPClientpapaaxiosExample for using the included libraries
An Axios example for transferring two measurement data points via HTTP to a LDB import interface:
const axios = require('axios') // already included when calling the transform function
axios({
method: 'post',
url: 'https://user:pwd@labordatenbank.com/demo/imports/import/x/0/https',
data: [ { "pH-Wert": 7.4 },
{ "LF": 1200 } ]
}).then(function (response) {
console.log("Response from import interface: " + response.data.msg);
});
A day.js example for date conversions:
const dayjs = require('dayjs') // already included when calling the transform function
// Create dayjs Object from Unix timestamp
let production_date = dayjs.unix(1637762955)
console.log("Production date: " + production_date.format('DD.MM.YYYY'));
let expiration = production_date.add(2, 'year')
console.log("Expiration date: " + expiration.format('DD.MM.YYYY'));
An SFTP example:
async function transform(data) {
const client = new SFTPClient()
try {
await client.connect({
host: 'test.rebex.net',
username: 'demo',
password: 'password',
})
console.log('Connection successful!')
// The input string must be transformed using Buffer.from as the first parameter. This is the data that will be written to the uploaded file.
// upload_filename.txt is an example filename. Any filename is required to upload the data in the 1st parameter.
await client.put(Buffer.from('Example Input String'), 'upload_filename.txt')
} catch (e) {
console.error('SFTP Error', e.message)
}
}
Continue with: Transformation code for evaluations
Laatste wijziging: 21.08.2026
Algemeen
Leveranciersbeoordeling
Materiaal
Medewerkers
Klanten
Opdrachten
Monsters
PDF-sjablonen
Bijlagen
Recepten
Verslagen
Editor voor rapporttabellen
Interfaces
Kompetenzen
AI-functies
Inleidende fase
Analyses
Sjablonen
Klantenportaal (optioneel)
Aanbiedingen
Facturen
Parameters
Rekenwerk met parameters
Webservices
Transformatiecode
Controleplannen / Grenswaarden / Specificaties
Documentbeheer
Vragen en antwoorden
Testmiddelen
Opleidingen voor medewerkers
8D-rapport
Overige
Bestandsbeheer
Processen