Programme Step - Modify Data

Use this step to alter the data in the programme or to append data from a data module.

The returned data from the function should be a JavaScript object. The data returned is merged into the programme data overwriting on any collisions. The data being returned should only be the data you want to merge in.

Example of a Modify Data step

Property Meaning
Modify Function A Javascript function that returns an object with properties
The function will either accept 1 or 2 parameters, depending on whether a Module Data Class is selected.
If no Module Data Class is selected then the function should accept 1 parameter.
Parameter d = ProgrammeData
Parameter c = the defined by the Module Data Class (e.g. customer data)
The returned object will be merged into the programme data
Module Data Class The class to select data from

Example Javascript for the step

function(programmeDataMap, customer) {
  var postcode = customer["Postcode"] || "Unknown";
  return {"Postcode":postcode};
}

This function is passed the parameters programmeDataMap which contains all data for the current running programme, along with the Customer's data, as defined by the Module Data Class.

The function returns an object with a property of "Postcode" taken from the customer's data. The programme will then merge the resulting object into the programme data map.

For more detail on the Module Data and how it can be used, see  Programme Modules.

Still need help? Contact Us Contact Us