Introduction to Custom data

The basics

Each Plugboard object has a set of fields representing that particular object, like Product, Order, Invoice and so on. The Plugboard object can be interchanged with external systems via Connectors. Each Connector has transformation logic to interpret that particular external systems representation of the object into Plugboard object. In both directions. 

When data exists on object (or in relation to the object) in external system, there might be situations where the data has no corresponding logical placement in a Plugboard object. In such cases Custom data can be used. 

Illustration

If we zoom in between the Connector and Manipulator chain in the below example we notice an Order object. For example, we can look at importing orders from external system:

  1. Plugboard reads order from external system, via a Connector.
  2. Connector interpret the order from the external system into Plugboard object. 
  3. Some additional data not possible to hold in the generic Plugboard object are stored as Custom data. 
  4. The object is then processed by the Manipulator chain.
  5. Finally the order is stored in Plugboard.  Awaiting further actions. 

Custom_data_structure.png

 

Anatomy 

Just to give a more technical example how custom data might look like one can look at the following;

{
"customData":{
"5377568eb7e165e3b38af6eece4a0001|connector.woocommerce|meta._wc_klarna_environment":{
"connectionId":"5377568eb7e165e3b38af6eece4a0001",
"moduleId":"connector.woocommerce",
"key":"meta._wc_klarna_environment",
"type":"string",
"value":"test"
},
"5377568eb7e165e3b38af6eece4a0001|connector.woocommerce|meta._wc_klarna_country":{
"connectionId":"5377568eb7e165e3b38af6eece4a0001",
"moduleId":"connector.woocommerce",
"key":"meta._wc_klarna_country",
"type":"string",
"value":"SE"
}
}
}

Record

Each available custom data record is living inside customData field with a unique string to identify and access it.  

Module id

The module id this record belongs to. 

Key

Unique key within module. 

Type

The data type of the value. Might be one of the following;

  • string
  • bool
  • integer
  • decimal
  • json

Value

The specific value for the custom data to hold.  

Further reading

Read more about Custom data in Plugboard API and also how to use Data view to help working efficiently with custom data on objects. Custom data could also be used with Processing rules