Skip to content

Value Transformer

Defining a Value section

Value transforming is used to set a value for a given key. This could be as simple as transforming a string to a number. Or something involving complex data manipulation.

Property Slug Description
processor 'REKEY'
functionTransformersKey The key to the object with the value property changes

Here is an example of the value processor TransformTask in the 'transformOrder'

direction: {
  transformOrder: [
    {processor: ProcessorKeys.VALUE_TRANSFORM, functionTransformersKey: 'valueTransform' }],
  valueTransform: {
    itemNumber: (row/*, dependencies*/) =>{
      const origValue = row['itemNumber'];
      return '' + origValue;
    }
  }
}

const data = {
  name: 'Bob',
  itemNumber: 1045
}

//... transform data

//Expected results
//{
//  name: 'Bob',
//  vibeIQIdentifier: '1045' //Note the value is now a string
//}